Hello @User, Here is an example for Amazon.
I am opening Amazon.
I am searching for Boat Headphones
I am selecting a particular headphone.
Here is the code I used.
import org.openqa.selenium.By;
import org.openqa.selenium.Keys;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class AmazonShoping {
public static void main(String[] args)
{
System.setProperty("webdriver.chrome.driver","C:\\Users\\priyj_kumar\\Downloads\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("https://www.amazon.in");
driver.findElement(By.id("twotabsearchtextbox")).sendKeys("Boat Headphones",Keys.ENTER);
//checking for a particular boat headphone say Boat BassHeads 900 Wired Headphone with Mic
driver.findElement(By.linkText("Boat BassHeads 900 Wired Headphone with Mic")).click();
}
}
Let me know if this was what you were looking for.
Hope this will help!
To learn more, go for Python Master course today.
Thank!