jeudi 25 mai 2017

Taking a screenshot of a modal window produces a black image

I'm using IE11 and Java under Eclipse. I'm not running the test on a remote system nor Am I using an RDC. This test is running on my local machine.

When I try to take a snapshot of the following screen, Selenium seems to have a problem with it.

Selenium cannot take a screenshot of this modal

This is what it does when the following code is executed:

File scrFile = ((TakesScreenshot) webdr).getScreenshotAs(OutputType.FILE);

  1. It moves the modal window in steps up and to the left. So if the original window position was (5,5) it moves it to (4,4)
  2. It plays the "alarm" sound -- (ding!)

It does this for about three times and then continues onto the next statement.

The result of screenshot process is a black image. enter image description here

Aucun commentaire:

Enregistrer un commentaire