Reputation: 78
I have code for taking screenshot of web apps in QTP. At one instance i want to take screenshot of the dropdown list with the list showing but not able to manage that.
Upvotes: 0
Views: 880
Reputation: 20456
Here's a way to do it, hope this helps...
SystemUtil.Run "Iexplore.exe","http://www.computerhope.com/jargon/d/dropdm.htm"
strPath="C:\dropdown_screenshot.bmp"
Setting.WebPackage("ReplayType")=2
Browser("Browser").Page("What is dropdown menu?").WebList("s").Click
Browser("Browser").Page("What is dropdown menu?").CaptureBitmap(strPath)
Browser("Browser").Page("What is dropdown menu?").WebList("s").Select "Choice 2"
Setting.WebPackage("ReplayType")=1
Dropdown list screenshot was captured successfully.
Upvotes: 5