Selenium技巧 - 用WaitForCondition进行等待

Selenium技巧 - 用WaitForCondition进行等待

selenium.open("http://www.bitrepository.com/apps/viewDemo/?originalPost=http://www.bitrepository.com/dynamic-dependant-dropdown-list-us-states-counties.html&demoPage=http://www.bitrepository.com/demo/dynamic-dependent-dropdown-list/");
selenium.selectFrame("mainFrame");
selenium.select("state", "label=California");
selenium.waitForCondition("var value = selenium.browserbot.findElementOrNull('loading_county_drop_down'); value.style.display == 'none'", "10000");
selenium.select("county", "label=Amador County");

更多WaitForCondition的使用例子请参考原文:

http://blog.browsermob.com/2011/03/selenium-tips-wait-with-waitforcondition/

posted on 2011-04-03 16:40  TIB  阅读(3905)  评论(0编辑  收藏  举报

导航