Hi I'm learning automation testing using Eclipse, Selenium Webdriver, and Java. I'm practicing. I'm trying to select the label 'Consumer Electronics' from the Ebay dropdown menu and search only in that category. Below script is what I have. It runs but what I notice is even though it will open the drop down and highlight 'Consumer Electronics', it actually is still searching in 'All Categories'. I'm using css to select 'Consumer Electronics'. What am I doing wrong?
Thanks.
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class EbayTest {
public static void main(String[] args) {
WebDriver driver = new FirefoxDriver();
driver.get("http://www.ebay.com/");
driver.findElement(By.name("_nkw")).sendKeys("Klipsch Status");
driver.findElement(By.name("_sacat")).click();
driver.findElement(By.cssSelector("option[value='293']")).click();
driver.findElement(By.xpath(".//*[@id='gh-btn']")).click();
}
}