i am trying to fetch data from a website using Selenium automation when i am trying to access data from that web site i am getting following exception
run
To check your code I tried the following:
@Test
public void test1() throws Exception {
System.setProperty("webdriver.chrome.driver", "t:\\Others\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
String url = "http://www.upmandiparishad.in/commodityWiseAll.aspx";
driver.get(url);
Thread.sleep(5000);
new Select(driver.findElement(By.id("ctl00_ContentPlaceHolder1_ddl_commodity"))).selectByVisibleText("Paddy");
Thread.sleep(5000);
driver.findElement(By.id("ctl00_ContentPlaceHolder1_txt_rate")).sendKeys("27/03/2014");
Thread.sleep(5000);
driver.findElement(By.id("ctl00_ContentPlaceHolder1_btn_show")).click();
Thread.sleep(5000);
driver.close();
}
It works fine with FireFox (29.0) and Chrome (34.0) drivers. I used the following jar-s:
You should check your project build path and add the appropriate jar-s. But you can find the missing class file in the selenium-server-standalone-2.XY.0.jar if you open it: selenium-server-standalone-2.41.0.jar\org\apache\http\entity\ContentType
Another way is to use httpcore.jar (httpcore-4.3.jar) that contains the missing class file.