Menu

ExplicitTestNG

By testautomation | Selenium Code

Aug 27
package selenium;


import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

public class ExplicitTestNG {

	WebDriver driver = null;

	@BeforeMethod
	public void beforeMethod() {
		System.setProperty("webdriver.chrome.driver", "C:\\chrome\\chromedriver_win32\\chromedriver.exe");
		driver = new ChromeDriver();

	}

	@Test
	public void testExplicit() {
		driver.get("https://testautomation.co/webelements/");
		WebDriverWait wait = new WebDriverWait(driver,10);
		wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("explibutton")));
		driver.findElement(By.id("explibutton")).click();

		

	}

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

	}

}

About the Author

Leave a Comment:

Leave a Comment: