You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a test fails and takes a screenshot or if you call the saveScreenshot function directly and you are on Firefox, you will get an error from Geckodriver:
Error
Response 500 GET /session/97e7684a-f42d-45f0-9428-5f957de28cc4/screenshot (3ms)
{
value: {
error: 'unknown error',
message: 'SecurityError: Permission denied to access property "pageXOffset" on cross-origin object',
stacktrace: ''
}
}
Error Error while running .getScreenshot() protocol action: SecurityError: Permission denied to access property "pageXOffset" on cross-origin object
Error
This screenshot is taken just fine when running Chrome, and with Firefox all you have to do is travel below to the parent frame before you try to take the screenshot. I think if we just add this line or something similar right before we take the screenshot it will travel to the Parent Frame and have no affect on Chrome or other browsers:
Note: One thing that could happen is if you are in an iFrame it will bring you to the parent if you call the function directly, so you will have to go back to the Frame if you want to continue to test within it. Some way of detecting whether you are in a frame or not could be added to automatically move you back into the frame after taking the screenshot would be ideal.
Here is the logs of the code running on Firefox successfully:
Sample test:
launch with a firefox browser config with screenshots save on failure:
'Handling Nested iFrames': function (browser) {
browser
.url('https://the-internet.herokuapp.com/nested_frames')
.frame(1)
.saveScreenshot('./testScreenshot')
.frame(2)
.assert.containsText('#content', 'MIDDLE') //failure assert to test the save screenshot on failure
}
The text was updated successfully, but these errors were encountered:
When a test fails and takes a screenshot or if you call the saveScreenshot function directly and you are on Firefox, you will get an error from Geckodriver:
This screenshot is taken just fine when running Chrome, and with Firefox all you have to do is travel below to the parent frame before you try to take the screenshot. I think if we just add this line or something similar right before we take the screenshot it will travel to the Parent Frame and have no affect on Chrome or other browsers:
right before
nightwatch/lib/api/client-commands/saveScreenshot.js
Line 23 in 3020374
Note: One thing that could happen is if you are in an iFrame it will bring you to the parent if you call the function directly, so you will have to go back to the Frame if you want to continue to test within it. Some way of detecting whether you are in a frame or not could be added to automatically move you back into the frame after taking the screenshot would be ideal.
Here is the logs of the code running on Firefox successfully:
Sample test:
launch with a firefox browser config with screenshots save on failure:
The text was updated successfully, but these errors were encountered: