Hi All
I have some questions for an object that is within an iframe.
As I share the screenshot
Object - div_PR has a frame ‘frame’ as its parent. The frame in turn has a parent iFrame ‘iframe’ as its parent
What happens if I don’t use the keyword ‘SwitchtoFrame’?
Which of the 2 options below is valid?
I tried the 2 options below and in both cases - Katalon seems to find the object. Only that after finding the object, it doesn’t really do anything else.
Option 01
Dont use the keyword ‘SwitchtoFrame’
For the object ‘div_PR’, I have set the Parent iframe field as ‘frame’
And for the object ‘frame’, I have set the Parent iframe field as ‘iframe’
As we see in the script, I don’t have the keyword ‘SwitchtoFrame’
When I run the test case, it seems to successfully find the object ‘div_PR’
But it doesn’t actually perform the ‘click’ . This is a false pass
Option 02
Use the keyword ‘SwitchtoFrame’
For the object ‘div_PR’, I have set the Parent iframe to be blank
At this point I assume that since I used ‘switchtoFrame’ - I don’t need to re-specify that the object is within an iframe
And for the object ‘frame’, I have set the Parent iframe field as ‘iframe’ (same as Option 01)
As we see in the script, I have the keyword ‘SwitchtoFrame’
When I run the test case, this too, seems to successfully find the object ‘div_PR’ (and execute the next step ‘verifyTextPresent’ as well. But just like Option 01 - it doesn’t actually perform the ‘click’ and doesn’t find the text present. Both these steps are false pass as well
Which of the two options - 1 or 2 - is the correct way to reference an object within an iframe?
And why doesn’t the object get clicked even after katalon finds it?