Menu

ImplicitTestNG

By testautomation | Selenium Code

Aug 27
package selenium;

import org.testng.annotations.Test;
import org.testng.annotations.BeforeMethod;

import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.AfterMethod;

public class ImplicitTestNG {
	WebDriver driver = null;

	@Test
	public void testImplicit() {
		driver.get("https://testautomation.co/webelements/");
		driver.findElement(By.id("link2courses1")).click();
		

	}

	@BeforeMethod
	public void beforeMethod() {
		System.setProperty("webdriver.chrome.driver", "C:\\chrome\\chromedriver_win32\\chromedriver.exe");
		driver = new ChromeDriver();
		driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
		
	}

	@AfterMethod
	public void afterMethod() {
		// driver.quit();

	}

}

About the Author

Leave a Comment:

Leave a Comment: