1

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 Answer 1

1

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.

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

1 Comment

I would however I need more rep.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.