Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I do it like this but keep in mind that this is pure WebDriver without the Grid or RC in mind:</p> <pre><code>// Utility class snippet // Test classes import this with: import static utility.*; public static WebDriver driver; public static void initializeBrowser( String type ) { if ( type.equalsIgnoreCase( "firefox" ) ) { driver = new FirefoxDriver(); } else if ( type.equalsIgnoreCase( "ie" ) ) { driver = new InternetExplorerDriver(); } driver.manage().timeouts().implicitlyWait( 10000, TimeUnit.MILLISECONDS ); driver.manage().window().setPosition(new Point(200, 10)); driver.manage().window().setSize(new Dimension(1200, 800)); } </code></pre> <p>Now, using JUnit 4.11+ your parameters file needs to look something like this:</p> <pre><code>firefox, test1, param1, param2 firefox, test2, param1, param2 firefox, test3, param1, param2 ie, test1, param1, param2 ie, test2, param1, param2 ie, test3, param1, param2 </code></pre> <p>Then, using a single .CSV parameterized test class (that you intend to start multiple browser types with), in the @Before annotated method, do this:</p> <ol> <li>If the current parameter test is the first test of this browser type, and no already open windows exist, open a new browser window of the current type.</li> <li>If a browser is already open and the browser type is the same, then just re-use the same driver object.</li> <li>if a browser is open of a different type that the current test, then close the browser and re-open a browser of the correct type.</li> </ol> <p>Of course, my answer doesn't tell you how to handle the parameters: I leave that for you to figure out.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload