开发者

Selenium extensions: "blocking" commands

Is it possible in selenium to write blocking commands?

I want to make a "clickAndWaitForAjax" comma开发者_如何学Pythonnd. It will click a button and wait until a div is filled with text from the server.

It is clear to me this can be done with two commands, but can it be done with one? How?


The best practise for this is to wait for elements on the page to be in the div. You can use a number of different commands like waitForElementPresent, waitForElementVisible,etc or you can write some JavaScript to check if the element in the DOM and use waitForCondition.

These are standard Selenium commands and can be ported to a programming language of your choice if you wish to run your tests running Selenium RC


If you write your scripts as JUnit tests, then it's all just Java code. You can easily write a single method that calls one, two, or a whole lot of different selenium methods. Or you could use your favourite language and testing framework.

This makes it much easier for testing complex systems.

See Selenium RC documentation for details.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜