Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Screenshots using Selenium IDE Firefox plugin

Using Selenium IDE Firefox plugin, I want to take automated screenshots. The test script contains of two lines:

Command: open; Target: http://www.google.com
Command: captureEntirePageScreenshotAndWait

The log shows:

[info] Executing: |open | http://www.google.com | |
[info] Executing: |captureEntirePageScreenshotAndWait | | | 
[error] Unexpected Exception: [Exception... "Component returned failure code: 0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH) [nsILocalFile.initWithPath]" nsresult: "0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH)" location: "JS frame :: chrome://selenium-ide/content/selenium-core/scripts/selenium-api.js :: <TOP_LEVEL> :: line 3045" data: no]. toString -> function toString() { [native code] }, message -> Component returned failure code: 0x80520001 (NS_ERROR_FILE_UNRECOGNIZED_PATH) [nsILocalFile.initWithPath], result -> 2152857601, name -> NS_ERROR_FILE_UNRECOGNIZED_PATH, filename -> chrome://selenium-ide/content/selenium-core/scripts/selenium-api.js, lineNumber -> 3045, columnNumber -> 0, inner -> null, data -> null, location -> JS frame :: chrome://selenium-ide/content/selenium-core/scripts/selenium-api.js :: <TOP_LEVEL> :: line 3045

How to get screenshots?

like image 763
user2317194 Avatar asked Mar 10 '14 12:03

user2317194


People also ask

Can Selenium IDE take screenshots?

captureScreenshot (name of screenshot) - Selenium IDE command. captureEntirePageScreenshot takes a screenshot of the whole web page. captureScreenshot takes a screenshot of the visible website part (viewport). This command has the side effect of giving the tab that runs the macro the focus.

Which command is used to capture a screenshot in Selenium IDE?

In the case of Selenium IDE, we can take screenshot during Automation testing using the command 'CaptureEntirePageScreenshot'.

Is Firefox plugin a Selenium IDE?

Selenium IDE is an integrated development environment for Selenium tests. It is implemented as a Firefox extension, and allows you to record, edit, and debug tests.


1 Answers

Setting the file path correctly solved it. The path needs to be set as follows:

(Windows:)

Command: captureEntirePageScreenshotAndWait; Target: D:\\Screenshots\\test.png

(Linux:)

Command: captureEntirePageScreenshotAndWait; Target: \\Screenshots\\test.png

In this example, the folder 'Screenshots' must exist.

like image 189
user2317194 Avatar answered Nov 03 '22 00:11

user2317194