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 8321735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:07:36+00:00 2026-06-08T23:07:36+00:00

I have WebDriver and am using Java. In C# with WatiN I was able

  • 0

I have WebDriver and am using Java.
In C# with WatiN I was able to write something like this:
Method

Browser browser = new Browser()
This is where what I would do with the browser would go. Like navigating to the URL

Then I would create a test method and actually define the browser
[TestMethod]
Method_IE
Method(new IE());

Is there anyway to do something like this in Eclipse with WebDriver?

  • 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-06-08T23:07:38+00:00Added an answer on June 8, 2026 at 11:07 pm

    We came up with something pretty simple for use in the page object model.

    public WebDriver GetDriver(String driver, String url){
    
        WebDriver driver;  
    
        if( driver == 'firefox'){
           driver = new FirefoxDriver();
        }
        else if(driver == 'chrome'){
           driver = new ChromeDriver();
        }
        else if(driver == 'ie'){
           driver = new InternetExplorerDriver();
        }
        driver.get(url); 
        return driver
    }
    

    Your IDE shouldnt matter at all as long as you specify the class in your source.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a test method created using Selenium, something similar to this: [TestFixture] public
I'm using Selenium Java 2.0b3 . I have this code: ... WebDriver driver =
Using capybara 1.0.0 and selenium-webdriver 0.2.0 and in a test I have something like
I'm still new to C# programming and have been able to get WebDriver working
I'm new on Watir-webdriver. I have tried running watir-webdriver using Firefox on http://bit.ly/watir-example I
I am using WebDriver with Java for test automation. I have the following HTML
I have some tests created using Selenium WebDriver. When I run them using IE
I have seen lots of questions and solutions on File upload using Selenium WebDriver
I'm using IE8 and webdriver. The problem I have is every time webdriver runs
I have the following html code: I saw that for Watir-webdriver the Watir::Image.file_size method

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.