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?
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.
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.
Solution:
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.