搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

Learn More

how can i set by-default iframe targeted document in console ?

  • 6 回覆
  • 1 有這個問題
  • 4 次檢視
  • 最近回覆由 nikhil.etc

more options

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.

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)

more options

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:

https://discourse.mozilla.org/c/devtools

more options

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

more options

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?

more options

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.

more options

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

more options

Thanks, that's what i am going to do. Cheers