Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interacting with 3rd layer of frames - workaround accessing subframe URL directly #1129

Closed
GitarooDan opened this issue Nov 8, 2021 · 5 comments
Assignees
Labels

Comments

@GitarooDan
Copy link

Hi there,

I found an old discussion which referenced by query here and the answer was that tagui was not (at that time) setup to work with 3 layers of frames. From my testing, this seems to be where my automation is falling over. Is there any way around this? I have tried to fiddle the tagui_parse.php file and it now accepts "frame | frame | frame" and translates to...

casper.then(function() {techo('frame a | b | c');});
chrome.withFrame('a', function() {chrome.withFrame('b', function() {chrome.withFrame('c', function() {
{ // start of code block
// code removed
} // end of code block
});});});

However it can't seem to find elements within the 3rd layer of frame like this.

@ruthtxh
Copy link
Collaborator

ruthtxh commented Nov 11, 2021

Hi @GitarooDan I don't think it works beyond 2 layers of iframes.
Do you have a website that I can take a look at to see if there's any workarounds?

CC @kensoh to look into this when he is available.

@GitarooDan
Copy link
Author

Thanks for getting back to me - the website is an internal one I'm afraid so I can't share it but I have since writing this started getting the URL of the first frame, appending it to the main page URL, opening that as a separate page and then interacting with the further 2 frames from there.

read //iframe[@id='iframeMain']/@src to frameurl
https://[ourwebsite]/desktop/dotnet/desktop/frameurl
frame appFrame
click //*[@name='Select']
frame appFrame | Picker
type UsernameTextBox as username
echo Huzzah I'm into the third frame

It's working, if a little inelegant. I'd still be interested in why my initial solution didn't seem to work!

@kensoh
Copy link
Member

kensoh commented Nov 25, 2021

Adding on, hi @GitarooDan, your initial solution does not work because other than changing tagui_parse.php, there is also a need to change the chrome.withFrame function in tagui_header.js. TagUI is designed and tested to only work with 2 layers of frames, thus inside the chrome.withFrame function in tagui_header.js the code and logic only handles a main frame and sub frame context. And there isn't code there to cater for a 3rd parameter for a further sub frame.

Your working solution is great, by accessing the initial frame directly, you have gotten around this current TagUI limitation.

PS - sorry for my slow reply, was away past few weeks to organise my mum's funeral and coming back to work again

@kensoh kensoh added the query label Nov 25, 2021
@kensoh kensoh self-assigned this Nov 25, 2021
@kensoh kensoh changed the title Interacting with 3rd layer of frames Interacting with 3rd layer of frames - workaround accessing subframe URL directly Nov 25, 2021
@GitarooDan
Copy link
Author

No worries @kensoh - I'm sorry to hear that, it must be an incredibly difficult time for you. I hope you're doing alright and thank you for taking the time to get back to me.

@kensoh
Copy link
Member

kensoh commented Nov 29, 2021

Thank you for sharing my pain @GitarooDan, I appreciate it 🙏🏻 I'll have to hurriedly return to my duties as breadwinner and also supporting baby care, though I would wish for more time for grieving and more quiet moments to remember my mum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants