how can i set by-default iframe targeted document in console ?
I want to set by default iframe is selected without clicking on the console toolbar. i don't want to click each time when I write a query for an iframe. at the moment i need to click on console and select frames.
所有回覆 (6)
I don't know how you can open the Web Console directly into a particular iframe. It might be faster to right-click in the frame and choose Inspect Element, then click Console.
Otherwise, the DevTools team has a forum over here:
Thanks for your prompt reply, actually i am trying to automate my application it contains stripe iframe, and i am not able to do that, because it's not going inside the iframe. it would be great if you could give some suggestion
I don't understand what you mean here:
Thanks for your prompt reply, actually i am trying to automate my application it contains stripe iframe, and i am not able to do that, because it's not going inside the iframe.
Do you mean there is no content loading into the iframe, so you can't click inside it? Could you use a border and min-height and min-width on a containing element to work around that while testing?
Content is loading, outside of iframe element is visible
browser .pause(3000) // outside iframe .waitForElementVisible('[id="card-number"] iframe', 4000) .frame(0) //go inside credit card input iframe .waitForElementVisible( '[aria-label="Credit or debit card number"]', 4000 ) .setValue( '[aria-label="Credit or debit card number"]', '4242424242424242' ) .frame(null);
its not going inside iframe. when i run in nightwatch (firefox ) its says ([aria-label="Credit or debit card number"]) not found even though this is works fine for chrome and Internet exploere.
Sorry, I don't know how Nightwatch works. Could this be a cross-site security issue? Actually, I would expect all browsers to prevent a script running in the outer page to manipulate elements in the frame across sites.
Perhaps you could open an issue here: https://github.com/nightwatchjs/nightwatch/issues
Thanks, that's what i am going to do. Cheers