I did the same for the Selenium project. Hope will be helpful
Please install TestNG and Maven on your system. Follow steps 1 to 8 and run the project
Step: 1 Right-click on Java Project, select "Configure Transition" in "Convert to Maven Project".
Follow Figure 1.1 and Figure 1.2


Step: 2 Add all the dependencies (required banks and surefire-plugin plugins for testing.xml)

How to add cans,
Path: 1 Search in " https://mvnrepository.com/ " and add the repository
Path: 2 Add banks from the local system (select either path1 or path2 or both, if necessary) Create a folder (Say: lib) and put it in the same directory
<dependency> <groupId>selenium-server-standalone-3.3.1</groupId> <artifactId>selenium-server-standalone-3.3.1</artifactId> <version>3.3.1</version> <systemPath>${basedir}/lib/selenium-server-standalone-3.3.1.jar</systemPath> <scope>system</scope> </dependency>

Step: 3 Convert the class to a test class

Step: 4 Modify test.xml.
Provide class name save it
<suite name="Suite"> <test name="Test"> <classes> <class name="test.java.CurseraTesting" /> </classes> </test> </suite>
Step: 5 Your class should contain Annotation @Test
If not, add. See the program below.
package test.java; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.testng.annotations.Test; public class URL { @Test public void openUrl() throws InterruptedException{ System.setProperty("webdriver.chrome.driver","C:\\Users\\shivendra.pandey\\Downloads\\chromedriver.exe"); WebDriver driver = new ChromeDriver(); driver.get("https://www.google.co.in/?gfe_rd=cr&ei=EjlbWbnFPOSK8QeylZ7ACw"); Thread.sleep(1000); driver.manage().window().maximize(); driver.findElement(By.xpath("//*[@title='Search']")).sendKeys("sanfoundry"); Thread.sleep(1000); driver.close(); } }
Step: 7 At the end, check all settings of TestNG, JDK

Step: 8 Run the project, click Maven Test
