Open strabbit opened 7 years ago
Hey Strabbit,
If you log what the output of let frames = await mainTab.getFrames();
, what do you get?
I've been using this library a lot lately - so I may be able to help.
M
[ { id: '21949.1',
loaderId: '21949.2',
url: 'http://strabbit.com/frame-example/frameset.html',
securityOrigin: 'http://strabbit.com',
mimeType: 'text/html' },
{ id: '21949.2',
parentId: '21949.1',
loaderId: '21949.3',
name: 'the_frame',
url: 'http://strabbit.com/frame-example/frame.html',
securityOrigin: 'http://strabbit.com',
mimeType: 'text/html' } ]
Meaning I'm passing 21949.2
as frame
to mainTab.click
.
I've edited the original post. It works for iframe
s but not for frame
s in a frameset
.
Hi @strabbit !
I've never used framesets. I think that the problem that you're having is related to how simple-headless-chrome tries to find the correct scope when you pass a frameId:
https://github.com/LucianoGanga/simple-headless-chrome/blob/master/lib/actions.js#L306
Do you know of a website with framesets so we can make a test case for the scenario that you need? We can modify simple-headless-chrome to support those cases.
Thanks! Lucho
Thanks @LucianoGanga
http://strabbit.com/frame-example/frameset.html is a very simple frameset example. It's the one I used to verify the issue.
Thanks! I'll look into it later. I'll let you know if I can fix and upload an example with that (I'll try to make some extra time to prepare a test case too, just to ensure future compatibility).
Cheers! Lucho
If I have a document that contains a frameset:
And that frame file contains a button:
I expect the following code to work:
Instead I receive this error:
What is the the correct value to pass as frameId? Is this a bug or am I just misunderstanding usage?