Selenium IDE "Screenshot on fail" plugin to capture screenshot when command execution fails

"Screenshot on fail" plugin for selenium IDE

"Screenshot on fail" plugin is developed by Samit Badle for advanced selenium IDE. Same as selenium IDE, "Screenshot on fail" plugin is Firefox add on. It is very useful plugin for selenium IDE to capture screenshot of page when your command execution fails due to the any reason like targeted element not
found of software application page, targeted text not found etc. So latter on, that command execution failure screenshot will helps you to find out actual reason of failure.


Installation of "Screenshot on fail" plugin for selenium IDE

  • Open https://addons.mozilla.org/en-US/firefox/ in your Firefox browser.
  • search for "ScreenShot on Fail (Selenium IDE)" from search box.
  • You will see "ScreenShot on Fail (Selenium IDE)" add on software in search result.
  • Click on "Add to Firefox" button display next to "ScreenShot on Fail (Selenium IDE)" add on as shown in bellow figure.


  • It will open popup to install "ScreenShot on Fail (Selenium IDE)" add on. Click on "Install now" button.


  • After completion of add on installation, it will ask to restart Firefox. Click on "Restart Now" button.



After restarting Firefox browser, open selenium IDE.

On selenium IDE window, You will see one more button in red color of "ScreenShot on Fail" as shown in bellow figure. That's what you need. Now you can use "Screenshot on fail" plugin with selenium IDE.



How to use "Screenshot on fail" plugin

Now let me describe you how to use this plugin. Copy-paste bellow given script in your selenium IDE. 


New Test
CommandTargetValue
openhttps://www.google.co.in/
verifyElementPresentid=gbqfq
verifyElementPresentid=gbqfba1
clickAndWaitcss=#gb_2 > span.gbts
verifyTextcss=#gb_2 > span.gbtsImages
verifyTextcss=#gb_8 > span.gbtsMaps1


In this script, i modified 2 commands manually as bellow.

1. Google search button's id 'id=gbqfba' with 'id=gbqfba1' so 3rd command "verifyElementPresent" will fail to execute because selenium will not find targeted element "id=gbqfba1" on page.


2. Actual Value 'Maps' of "verifyText" (6th command) is modified with 'Maps1'. So it will too fail.


Now before running this script, click on "Screenshot on fail" button to turn on this feature.





Now run this script. After completion of script execution, click on "view failure report" as shown in bellow given image. 





It will show you 2 files with name 'error1.png' and 'error2.png'. click and view both files one by one. 1st screenshot is captured during "verifyElementPresent" command failure and 2nd screenshot is captured during "verifyText" command failure. Every time it will create new folder to store these files. Folder name will be combination of current date and time. 

In this way we can automate the process of capturing screenshot when any command fails to execute due to the any reason. 

Click Here to view more plugins of Selenium IDE

1 comment:

  1. is there any way I can store them in their respective names?

    ReplyDelete