How to take the screenshots of Javascript alert

Russ Thomas said:

Did you try something like this?

WebUI.waitForAlert(10)

WebUI.takeScreenshot()
WebUI.acceptAlert()


  
Your problem might be that the call to JavaScript returns immediately (before the alert appears) and the code running in the webdriver context doesn't know it needs to wait or even handle it.  You have basically confounded the cooperation mechanism between the two execution contexts (webdriver and browser).  
  
As for your other question, there is no API I'm aware of that lets you interface directly to an executing Test Report (other than the obvious commenting and result(s) mechanisms).  But I could be wrong - I frequently am B)  
  
  

  

Hi Russ, Your suggestion didn’t work out. :frowning: Still facing the same issue.