开发者

Testing jquery slide using selenium

So in our app we have multiple popups appearing on the page and at any given time we shown only 1 popup to the user. The way we are showing the popup is we use jquerys show function with the animation set to slide. Now i want to write automated unit tests to check my popup and say that each popup has a set of similar elements like say the 开发者_C百科Ok and Cancel button each of them having different ids but same classes and I want to write a common function that tests all these popups. the test will be

a) see if ok and cancel button are present

b) click ok button and see if the button disappears etc.

How can i achieve the same using selenium and c#? Currently we have ended up giving ids to each one of these buttons and end up waiting for each element. Sometimes these tests just fail randomnly. Is there a better way to achieve the same.

Thanks in Advance.


I assume that, you're using only ids. Instead use CSS locators.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜