I need to create a command to capture screen shots on every click command automatically without manually inserting capture screenshot command in Selenium IDE.

Can anyone help me?

3 Answers 3


Selenium IDE has a Rollup feature:

Rollup – This option allows user to combine multiple test steps to act like a single command.

Try to combine the click and the screenshot into a rollup with parameters.

Some links:

Personally I think you might want to drop Selenium IDE for programming Selenium/WebDriver in a programming language like Java, because this gives you way more flexibility. I view Selenium IDE more as a toy that proves a concept, but not really as a tool that is a production ready for a lot of test-cases. Lucky it supports an export to a couple of programming language, so your effort is not lost.


The following example is in Java:

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

You can combine these. First "click" and then take screnshoot.

  • This is Webdriver code. The above question is related to IDE. Aug 31, 2015 at 5:31

I use click and screenshot in following way:

click | elementXpath
waitforvisible | elementIndicatesPageChangedXpath
captureEntirePageScreenshot | ${scrnPath}${date} ${TCResult} ${TCName}-{TCstepName}.png

which waits until page elements after click are loaded.


  • It could be combined in JavaScript plugin, where you can do all actions with a single NEW command (for example clickAndScreenshot) and use it as Selenium core extension (see options). Probably some scripts already exist, but not exactly you need. You have to write one. Good programming skills in JavaScript are necessary.
  • Or you can use SelBlocks and write your own Function which will do the job and you can use Stored variables in naming of the screenshot as I do above. You can click it trough in S-IDE by yourselves. Little programming skills are necessary.

In both cases u have to handle parsing of the parameters, because more than one is necessary. Use storeExpression of S-IDE and JavaScript x.search(searchvalue) and x.substring(searchvalue) functions.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.