Forum Discussion
Kanika wrote:For Example - I have to fill a questionnaire having 10 questions and out of which one question also contains image which by chance fail to load during loading of questionnaire questionnaire. How can I check this scenario and can capture error image?
Try:
Log.Picture (obj.Picture(), "image");
Of course obj needs to be set. I've used this while writing code to find an object with XPath:
var obj = page.FindChildByXPath("//table[@id='grdCribPrivileges_DXMainTable']//td[text()='" + Privileges[i] + "']/parent::node()/td[@onclick]", true);
I think the best way of error handling is :
if obj.Exists then
.......
.......
else
str = Log.Picture(page.Picture(), "User object not found")
end if
Please suggest if there is some other way apart from this.
- anuprai2911 years agoOccasional Contributor
Hi,
Try to handle event OnStopTest:
http://support.smartbear.com/viewarticle/56652/#ID0EZAnd within event handle function you can capture screen using method:
Sys.Desktop.Picture (ClientX, ClientY, Width, Height, Mouse)
and save screen capture on defined location.