ERP 2.50:Automated Testing/Screenshots
Contents |
Introduction
Several times, a failing Selenium test case does not show enough information through console output. That makes very difficult to understand what went wrong nor what is the required action to fix it.
So Openbravo's Selenium tests have a foundation feature for taking screenshots whenever a test case fails.
Where to find screenshots
It is important to note that if build is successful, no screenshot will be taken. Only failures will trigger an screenshot, which means standard number of screenshots is one. Eventually, a second screenshot could appear, as a consequence of parallelism. However, even in that case, only one of those screenshots will be signicant, the other might be a side effect.
When using Hudson CI jobs
Hudson's interface allows you to find easily an screenshot. You could find a "Screenshots" link in your job's main page.
When clicking that link, you will be redirected to the screenshot's list.
Sometimes, the direct link is not available. In that case, you should be able to go to
Workspace > automation > pi-smoke > last-results > qa-pi-inc-pgsql > screenshots
and you will get the same list as before.
Note that you need enough permissions to the job in order to access the list.
When using command line
You should navigate to
/selenium/{yourSeleniumCheckout}/last-results/{youOpenbravoContextName}/screenshots
For example, for using pi-smoke automation branch on a context named openbravo:
/selenium/pi-smoke/last-results/openbravo
Techincal info
Screenshots were added to the OpenbravoERPTest.java, in the failed method. Built-in command is used:
selenium.captureScreenshot(screenshotPath);