【发布时间】:2014-11-01 23:09:34
【问题描述】:
我在 selenium webdriver 中编写了一个脚本,它使用 click() 点击一个“dojo”元素的按钮。
以前它工作正常,但现在不工作,我尝试了所有可能的方法使其工作(使用 javascipt、等待元素存在、检查启用和禁用选项等),但似乎没有任何工作。
如果有人能帮我解决这个问题,我将不胜感激。提前致谢。我附上脚本和 html 代码供您参考。
public void Search_Project_Test(String Project_name,String Os_type,String Start_rel,String End_rel) throws InterruptedException, IOException
{
this.Software_type.click();
this.select_os_type(Os_type);
this.search_proj.sendKeys(Project_name);
com.wait_till_pageload();
SORA_Constants.driver.findElement(By.xpath("//button[@id='submit_project_search']")).click();
Thread.sleep(5000);
【问题讨论】:
-
定义“不工作”有例外吗?什么都没有发生?查看您尝试与之交互的元素的 HTML 也会很有帮助。
-
什么都没有发生,甚至没有抛出异常。这里是 html 代码“
-
你用的是什么版本的FF和Selenium?
-
我使用的是 firefox 31.0 和 selenium 2.42.2
-
@NilamberSingh ,我不确定,但似乎 selenium 2.41 版仅支持 Firefox 28,并且在 selenium 2.42.2 中没有提及 Firefox 31。我建议将 Firefox 降级到 28。
标签: selenium selenium-webdriver