How to open a web page using Selenium WebDriver?

How to open a web page using Selenium WebDriver?

1. Create a JAVA Class.

2. Enter class name and Save it.

3. Create a method inside the class. In my case I have created startTest().

3. Include @Test annotation.

4. Use the help icon to fix the issue by importing “import org.junit.Test;”.

5. Use the below code to open a web page.

                WebDriver wd = new FirefoxDriver();
wd.get(“https://www.infallibletechie.com”);

6. Fix the errors by importing the below

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;

7. Run it, so that it will open the page.

Cheers!!!

Leave a Reply