FullPageScreenshot inside iFrame

Hi Team,
I am not able to take FullPageScreenshot inside iFrame.Any Help appreciated . Thanks.

WebUI.takeFullPageScreenshot(filePath)

1 Like

Hi @kharitha17, Did you switch to the iframe 1st? How to handle iFrames using Selenium Webdriver: switchTo()

Hello @Dave_Evers ,Yes I did . Before switching to iFrame , FullPageScreenshot is working as expected.
Please let me know if you have any Inputs on this. Thank you!

Lack of information.

What PNG did you get? Please share the image file you got.

A completely blank rectangle?

A PNG which shows some texts around a blank rectangle as <iframe>?

A PNG which shows some texts around a rectangle as <iframe> which shows only a visible portion (not full page screenshot)?

Hi @kharitha17, As Kaz says we need more information.
See this post for more information as to what is needed:

Hi @kazurayam , In my Scenario I am placing the FullpageScreenshot step at end of every page. This is capturing visible portion not the full page. There is no text around the rectangle its a regular PNG.
image

Still I don’t see

  • what you expected to get, and
  • what you actually got

so I have no more idea

Hi @kazurayam
To work on my application I need to Login to the main application and then have to switch to frame (as my application is in an iFrame)


Scenario : In step 8 I am able to capture full page screenshot , but after switching to frame in step 14 , it is not capturing the full-page screenshot. I am able to capture only the visible portion (i.e; only the bottom part of the screen)

This is the keyword for capturing the screenshot. hope this helps.

I suppose, WebUI.takeFullPageScreenshot is not capable to take the full-page-screenshot of a document inside a <iframe> on the page. Out of the scope. You should abandon your idea.

Principally you need to somehow open the web page in another window outside the <iframe> and then take a full-page screenshot of the isolated window.

I have several ideas to try to pull out the page <iframe>. Howerver it could be complicated; it will require seasoned skills of Java programming, will involve a lot of try-and-errors. Also, your webapp challenges a “Login” processing which is usually highly domain-specifc. To solve any domain-specific technical issues, the developer would require you to allow her/him an immediate access to the webapp in question. Possily you will be asked to pay them.

I am not really interested in this issue. So I won’t devote myself into it.

@kazurayam Thank you for your inputs on this.

Alternative idea.

Can you speak to the developers of your target web app?

If possible, ask them to change the target web app a bit so that you can open the problem page in a window on its own, not inside <iframe>. I suppose it would be easy for them to implement that special arrangement.

Then you would be able to take a full-page screenshot of the window.

Hi @kazurayam , I have missed to mention one more scenario where I am able to capture FullPageScreenshot when I am inside iFrame.

Scenario:
Step-1 : I am logging into application and switching to iFrame in this step (as shown in the above post )
Step-2: I am stopping the Testcase after execution of step-1 , and from step-2 I am resuming the application by selecting the option Run from here
If I do this way , I am able to capture full page screenshots.
Below screenshot showing the Testcase
image

Hope this helps. Thank you !

@kharitha17

Nice to hear you have found out your way!

@kazurayam , still we can’t run this as a full test case. May be I should explore other options as you suggested.
Thank you for your inputs on this :blush:

I would recommend you to speak to the developers of your web app. Ask them to change the target web app so that you can open the HTML in an window, not within an <iframe>. You should ask them: “Please improve this web app a bit more testable; friendly to the testers”.

2 Likes