Mark Kadlec
Mark Kadlec

Reputation: 8460

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... ;)

Upvotes: 1

Views: 739

Answers (2)

Michael Sorens
Michael Sorens

Reputation: 36738

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.

Upvotes: 1

user793623
user793623

Reputation:

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...

Upvotes: 1

Related Questions