porscheinformatik / selenium-components

A small framework on top of Selenium to access web elements more easily.
MIT License
5 stars 5 forks source link

HtmlPage #3

Closed irozaji closed 5 years ago

irozaji commented 5 years ago

Hi,

The below line of code is not working, it is requiring two parameters and I could not figure out what to pass for the second parameter private final HtmlPage page = new HtmlPage( "https://localhost:8080" );

Thanks

thred commented 5 years ago

Thanks for your feedback.

You have to create a DefaultSeleniumEnvironment. You can reuse this environment. The environment needs a WebDriverFactory, there are implementations called ChromeWebDriverFactory, EdgeWebDriverFactory and FirefoxWebDriverFactory.

So the code looks like the follwing:

private final WebDriverFactory factory = new FirefoxWebDriverFactory();
prviate final SeleniumEnvironment environment = new DefaultSeleniumEnvironment(factory, "mySession");

private final HtmlPage page = new HtmlPage(environment, "https://localhost:8080" );

I will update the documentation as soon as possible.