XPath or CSS in Selenium RC with Java is not working

前端 未结 3 1985
Happy的楠姐
Happy的楠姐 2021-01-16 05:01

I am trying to automate the following scenario with selenium RC:

  1. Open Google home page and enter \"Software\" in search box and then click on search button.
3条回答
  •  独厮守ぢ
    2021-01-16 05:21

    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']");
    

提交回复
热议问题