XPath or CSS in Selenium RC with Java is not working

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 12:53:35

Just a side note, Google has a ban on automated queries. I was using Google to test when I was new to testing, now I use our own server.

What you are looking for is this:

//a[contains(text(), 'software')] 

This selects the first link with "software" in the link text.

Try this xpath (//a[@class="l"])[1]

there must be pause ( pause (1) ) or waitForElementPresent between 2 clicks here is working sample for phpUnit. Strange, but clickAndWait does'n work

$this->open("/");
$this->type("q", "software");
$this->click("btnG");
for ($second = 0; ; $second++) {
    if ($second >= 60) $this->fail("timeout");
    try {
        if ($this->isElementPresent("//a[@class='l']")) break;
    } catch (Exception $e) {}
    sleep(1);
}

$this->click("//a[@class='l']");
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!