-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Closed
Labels
I-questionApplied to questions. Issues should be closed and send the user to community resources.Applied to questions. Issues should be closed and send the user to community resources.
Description
What happened?
How can we reproduce the issue?
WebDriver driver = new Chrome Driver();
driver.get("http://example-ecommerce.com");
driver.findElement(By.name("q")).sendKeys("Laptop");
driver.findElement(By.id("searchBtn")).click();
List<WebElement> results = driver.findElements(By.className("product-title"));
boolean found = results.stream().anyMatch(result -> result.getText().contains("Laptop"));
Assert.assertTrue(found, "Laptop was not found in search results.");Relevant log output
Automating the search functionality ensures that the feature works correctly across different product searches. This saves time in verifying one of the most critical e-commerce functionalitiesOperating System
Windows 10j
Selenium version
java 4.0.0
What are the browser(s) and version(s) where you see this issue?
chrome 90
What are the browser driver(s) and version(s) where you see this issue?
chromeDriver 94.0.4606.61
Are you using Selenium Grid?
4.0.0
Metadata
Metadata
Assignees
Labels
I-questionApplied to questions. Issues should be closed and send the user to community resources.Applied to questions. Issues should be closed and send the user to community resources.