Iframe issue in Test Script

Hi Team,

I have used switchToFrame in my script and it is working fine in my local, but when integrating it with Jenkins , the elements in iframe is not getting loaded.

Could you please suggest on this?


1 Like


Have you put some wait/sleep until the iframe is loaded successfully yet? The Jenkins env might cause some unwanted loading issues more than the local one. Thank you!


Welcome to the forum @neha.thakur, as Elly says you likely need some sort of wait…
If you post your html code here, someone from the forum may be able give you more advice.

For example:
Add the following 30 second wait to the body of the test case:
Your test system may require longer wait times, we usually use 90 seconds.

//The following waits up-to 30 seconds per line.
WebUI.switchToFrame(findtestObject('iframe01'), 30); //opens iframe01
WebUI.waitForElementVisible(findtestObject('testObject1'), 30);
//Other steps can go here...
WebUI.switchToDefaultContent(); //closes iframe01

1 Like