import org.openqa.selenium.By; import org.openqa.selenium.Keys; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.testng.Assert; import org.testng.annotations.Test; public class TestSzit { @Test public void testTitle() { WebDriver driver = new ChromeDriver(); driver.get("https://szit.hu"); WebElement elem = driver.findElement(By.name("q")); elem.sendKeys("recept" + Keys.ENTER); boolean actual = driver.getPageSource().contains("Gluténmentes"); Assert.assertTrue(actual); driver.quit(); } }