webdriver的硒(RemoteWebDriver)不能点击网页上的任何地方 [英] Selenium Webdriver(RemoteWebDriver) can't click anywhere on the webpage

查看:361
本文介绍了webdriver的硒(RemoteWebDriver)不能点击网页上的任何地方的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习如何使用webdriver的硒(RemoteWebDriver),我有一些问题的网页我在训练上,因为我无法点击任何地方,我无法找到网页上的任何元素。

I'm learning how to use Selenium Webdriver(RemoteWebDriver) and I'm having some problems with a page I'm training on because I can't click anywhere and I can't locate any element on the webpage.

我认为该网页是通过使用Spring或者Ajax的开发,这就是为什么我不能去点击任何东西。

I think the webpage is developed by using Spring or maybe Ajax and that's why I can't get to click anything.

这是链接: http://tinyurl.com/d9x453

例如,我没有能力甚至preSS你可以在网页上看到的第一个按钮,难道我失去了一些东西?

For example, I'm not capable even to press the first button you can see on the webpage, Am I losing something?

请,我真的AP preciate,如果有人可以帮助我。

Please, I'd really appreciate it If someone could help me.

问候 -

推荐答案

另外随着selenium.fireEvent尝试(ID =搜索底,模糊)。[注没有带测试code]

Also Try with selenium.fireEvent("id=search-bottom", "blur").[Note havn't tested the code]

哪个浏览器,你想?

这是在code我想和大家分享:

This is the code I wanted to share :

private WebElement searchButton;

@Test
public void testYourSearchClick(){
     final FirefoxDriver ffDriver = XXYOURUtillyClassForDriver.createFirefoxDriver();
     try{
      ffDriver.get(System.getProperty("selenium.baseURL"));

    searchButton= ffDriver.findElement(By.xpath("//fieldset[@id='search-bottom']"));//or your   //button class
    searchButton.click();
}catch(SeleniumException e){
      e.printStackTrace();
    }
}

这篇关于webdriver的硒(RemoteWebDriver)不能点击网页上的任何地方的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆