为了检查您的代码,我尝试了以下 *** 作:
@Testpublic 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();
}
它可以与FireFox(29.0)和Chrome(34.0)驱动程序正常工作。我使用了以下jar-s:
- selenium-server-standalone-2.41.0.jar
- selenium-java-2.41.0.jar
- junit-dep-4.11.jar
- hamcrest-core-1.3.jar
您应该检查项目的构建路径并添加适当的jar。但是,如果打开它,则可以在selenium-server-
standalone-2.XY.0.jar中找到丢失的类文件:selenium-server-standalone-2.41.0.jar org
apache http entity ContentType
另一种方法是使用包含缺少的类文件的httpcore.jar(httpcore-4.3.jar)。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)