Detecting selenium commands
Is there anyway I can detect selenium commands so I can't automatically insert a screenshot command after each one? I would like to keep this in Javascript as I am using the html testscripts. Example:
clickandwait | element |
<-- is there a way to know via Javascrip开发者_运维百科t that this was fired so I add
captureentirepagescreenshot | c:\screenshots.jpg |
after it.
Do you want to take screenshots only if a prticular element is present on page? If yes, then in Selenium-RC the code will be
if(selenium.isElementPresent("yourElement")){
selenium.captureEntirePageScreenshot("c:\screenshots.jpg", "") }
You can try isElementPresent
in Selenium-IDE. I haven't tried this one though, so not sure about it.
精彩评论