Hi
How do we deal with the situation where the web element is in a frame - which is within an iFrame
When do ‘SwitchtoFrame’ - do we have to use the keyword for iFrame/Frame or both? I tried all 3 possibilities but it seems to not able to find the iFrame using any xpath/attruibutes.
Hi @anishas,
Remove the 5 second Delay.
Change the ‘Switch To Frame - frame_Contribution Receivables’ to 30 seconds or more.
Remove the second ‘Switch To Frame - frame’
Retry the test.
Alternatively this might help…
Create your self a new test object
Right click on Object Repository > New > Test Object
Create ‘testIframe’ for example
When I use the Object Spy - it identifies the object and iframe correctly
For the iFrame_Contribution Receivables - I cannot use the xpath ID (ext-gen5877) as a locator since the value changes with every run
And there is a frame within the iframe
So I have to SwitchTo ‘iFrame’ or ‘Frame’?
Why Katalon cannot find the Frame or iFrame?
// Waits up-to 10 seconds to switch to iframe (increase wait time if needed).
WebUI.switchToFrame(findTestObject('Object Repository/Iframe_Contribution_Receivables'), 10)
// Your code goes here ...
WebUI.waitForElementPresent(findTestObject('Object Repository/NewInvoiceBtn'), 10)
WebUI.enhancedClick(findTestObject('Object Repository/NewInvoiceBtn'))
// Switches from iframe to main page
WebUI.switchToDefaultContent()