0

I am writing tests for a webui, and have access to a WebGrid (actually Zalenium) stack to send my web ui tests to. We have requirements to test against different browsers on different platforms. Our implementation currently supports configuring from (really anywhere) the browser/platform used by the test using selenium capabilities. We are using Cucumber implemented with Java.

My question is how to best encompass all the tests across all browser/ platform combinations I want to test in a single run?

I know I could do something like:

Scenario Outline: Basic ui test
  Given browser "<browser>" on platform "<platform>"
  When user does something
  Then something happens
  Examples:
    | browser | platform |
    | firefox | linux    |
    ...

But this has several downsides:

  • That examples table needs to be kept consistent across many, many scenarios
  • Makes using examples more complex for actual parameters as designed (need to have the browser combinations set for each combination of actual example data)

Is there a way to rerun tests with different configurations outside of these examples? An option would be to simply run the test suite multiple times configured with a different browser/platform but I would prefer to keep it all in one run for reporting purposes.

1 Answer 1

3

I think it's easier to structure your tests and then do separate runs with the different browsers. Do this:

Browser 1:
Test 1
Test 2
Test 3

Browser 2:
Test 1
Test 2
Test 3

Rather than

Test 1:
Browser1
Browser2

Test 2:
Browser1
Browser2

Test 3:
Browser1
Browser2

IMO it's better to do runs across browsers like you would version rather than mix & match within tests. What if chrome breaks you'll see failures across the run, rather than at the browser level. It will take longer to decipher if it's a browser issue or a SUT issue.

Sign up to request clarification or add additional context in comments.

2 Comments

+1 Additionally, the browser and platform are better off as environment or configuration variables, which keeps browser information out of your tests.
You'd typically organize this in the build system. stackoverflow.com/a/66404674/3945473

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.