0
votes

I am using Selenium 2 WebDriver API and receiving Unable to locate element Error when I am running my Tests. The element is an iframe. But wait , when I run the test locally (in my local server) it works fine (via driver.switchTo().frame("frame id");) approach, but when my tests run on live server, the error arrives.

The one difference between them is that the live server is running on https. Is that the issue that WebDriver is not recognizing iframe over SSL ??

Any Help is appreciated.

1
It wouldn't be a Selenium issue, since it's just using the browser to interact with the DOM. I would use the debugging aspects in your browser (IE Developer Tools, Firefox Firebug, etc) to inspect the DOM and make sure the frame actually exists. - Rich
Post a copy of the page. - Arran
@Rich I have checked the page with developers tool of firefox, the frame actually exists. Also the tests ran successfully on local server but they are causing problems remotely. - Taha Iqbal
When you checked, did you check it in the server page which runs over SSL or in the local server - CheryJose
@CheryJose I have checked on both. I have deployed the same build on live server. Still can't figure out what is the issue :( - Taha Iqbal

1 Answers

0
votes

Use driver.switchTo().frame(index);