Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7495663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T18:15:35+00:00 2026-05-29T18:15:35+00:00

I just discovered selenium – a great tool! I plan to run/use selenium-ide generated

  • 0

I just discovered selenium – a great tool!
I plan to run/use selenium-ide generated junit4 code. But I need it to run with many browsers/web drivers.
Is there a junit/java-pattern for this use case? My first idea was to use @RunWith(Parameterized.class) and provide a List of WebDrivers (the parameter for the class – probably provided as an external file listing browsers and versions?!). Is this a good idea? Is it possible to provide a central @Parameters -method to be used by all my Selenium-tests?

What alternatives are there?

Probably it is possible to change the “Format” that Selenium exports to minimize manual changes?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T18:15:43+00:00Added an answer on May 29, 2026 at 6:15 pm

    Well, I do need to switch drivers from time to time, so I did this:

    I initialize selenium related stuff in my own Class – called by name of the application and the driver is approached by the getters. When calling my class constructor, I use enum type of driver to initialize with:

     private WebDriver driver;
     public TestUI(Environment.DriverToUse drv){
       switch (drv){
            case CHROME:{
                ChromeDriverService service = ChromeDriverService.createDefaultService();
                File file = new File(TestUI.class.getResource("/chromedriver.exe").toURI());
                System.setProperty(ChromeDriverService.CHROME_DRIVER_EXE_PROPERTY, file.getAbsolutePath());                
                ChromeOptions options = new ChromeOptions();
                options.addArguments("--start-maximized");
                driver = new ChromeDriver(service,options);
                driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
                break;
            }
            case FIREFOX:{
                FirefoxProfile ffProfile = new FirefoxProfile();
                ffProfile.setPreference("browser.safebrowsing.malware.enabled", false);
                driver = new FirefoxDriver(ffProfile);
                driver.manage().window().setPosition(new Point(0, 0));
                java.awt.Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
                Dimension dim = new Dimension((int) screenSize.getWidth(), (int) screenSize.getHeight());
                driver.manage().window().setSize(dim);
                driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
                break;
    
            }    
    
    public WebDriver getDriver(){
     return driver;
    }
    

    of course my Environment class looks like this

    public class Environment {
    public enum DriverToUse {FIREFOX, CHROME};
    // .. and some other stuff, because I need to test on different environments, so I store here Environment URL for example
    

    And my test class looks something like this

    @Before
    public static final Environment.DriverToUse USED_DRIVER = Environment.DriverToUse.FIREFOX;
    
    @Test
    public void testVersionNumber() throws Exception{
    
        TestUI testUI= new TestUI(USED_DRIVER);
        WebElement version = testUI.getDriver().findElement(By.id("the Id of element"));
        version.click();
        //...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just discovered the possibility to use vi-mode in zsh. Pretty awesome. But I
I just discovered a bug where the code looked something like this: char *foo
i just discovered http://code.google.com/p/re2 , a promising library that uses a long-neglected way (
I just discovered there is a Ajax success handler, which is great because its
So I want to get PHUnit up so I can run selenium server, but
I just discovered that some parts of the code I am working on incorrectly
Just discovered the jQuery :contains() selector and would like to use it however the
I just discovered zen-coding. I have the following snippet of code I want to
I just discovered wkhtmltopdf and I'm trying to use it in a perl CGI
I just discovered this issue, and I wanted to run it by everyone here

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.