开发者

Clicking a link in IE using Selenium does not work

I'm seeing a strange result, when I put the following in my JUnit code:开发者_开发百科

selenium.click("link=Test Link");

It works when I'm testing in Firefox but throws an error saying it can't find the link when I test in IE.

Is this a limitation with IE? That seems like a severe selenium bug, I'm banking I'm missing something... ;)


I guess you have the required setUp method for starting the test in IE which is;

public void setUp() throws Exception{
   setUp("http://www.google.com", "*iexplore");
}

public void test01 throws Exception{
   selenium.open("/");
   //I'd just wait for page to load before clicking anything
   // that might be a reason...

   selenium.waitForPageToLoad("20000");
   selenium.click("link=test link");
}

I hope that fixes it...


Do you have any frames on the page? In my experience different browsers can show slight differences in their tolerance for allowing Selenium to find elements if you do not explicitly drill down (or up!) to the specific frame containing the element in question.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜