Skip to content

Instantly share code, notes, and snippets.

@handakumbura
Created December 18, 2022 10:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save handakumbura/7af62940c7002c076b05a71bcdd55d22 to your computer and use it in GitHub Desktop.
Save handakumbura/7af62940c7002c076b05a71bcdd55d22 to your computer and use it in GitHub Desktop.
package com.dumiduh;
import com.dumiduh.constants.Constants;
import io.github.bonigarcia.wdm.WebDriverManager;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.Assert;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
public class CustomeLocatorTest {
private static ChromeDriver driver;
@BeforeClass
public static void setup() {
WebDriverManager.chromedriver().setup();
driver = new ChromeDriver();
driver.get(Constants.DYNAMIC_LOAD);
}
@Test
public static void byContainsText() {
Assert.assertTrue(driver.findElement(CustomBy.containsText("Powered by")).isDisplayed(), "the expected text value was not found in the html document.");
}
@AfterClass
public static void cleanUp() {
driver.quit();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment