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.
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?
This might help you…
Update your ‘Iframe_Contribution_Receivables’ object as follows: You might need to play with the values. For example, if there is more than one iframe object on your page you could use (//frame) or (//frame) or (//frame)… Using option two would allow you to pick the second 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)
// Switches from iframe to main page
Some more question in continuation of iFrame issue
I seem to manage to switch to the iframe and find the object as well
Below are my steps
However, when I try to look up in my input field - it doesnt match any value. I expect that on setting the text “112006” - a drop down list is populated and I select from the list. What am I doing wrong here?
Thank you so much for your help so far!!
Just wanted to provide more information about the same
This is my expected result when I enter the value ‘112006’ in the lookup field - this is not a drop down. User has to manually enter the value and the drop down list is auto populated from which user can select the value
However, in automation - what I get is - where the field just fails to find the value
Just to revise - my object is within a frame - which in turn is within an iframe as below
If I switched to iframe - iframe_AssetEntry - it wouldn’t work
So I switched to Frame - frame_AssetEntry
And I have set the iframe “iframe_Asset entry” to be a parent iframe for the frame “frame_AssetEntry”
And the object itself - input_Lookup - I have set to NOT have any parent object
I assume that since we are already in the frame - we no longer need to specify that the object - input_Lookup - is within a parent object. Not sure if my assumption is correct though!
And this is how it ends up finding the object input_Lookup
However, when I input the text ‘112006’ to start the lookup - it doesn’t find anything
Can I make a suggestion - try changing row 36 to use WebUI.sendKeys instead of setText. Using send keys is a better match to how the user enters text and some of these components are sensitive to how values are entered eg if some events are triggered by typing