我正在学习如何使用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();
}
}
相关推荐
最新文章