Follow the steps:
* After recording select waitforpage() in tree view - waitforpage() for loading report output page
* So you can see report output in Detail View
* If you want to do a test matching, select Browser tab in Detail view, select the text and right click and select Add Text Matching Text
If you want to fetch text from report output and save it in a String (so you can do validation or concatenation or what ever you want). Then select Browser tab in Detail view, select the text and right click and select Inspect Path
Press F10 and copy the path and use following structure
String reportOutput = web.element("paste your path").getAttribute("text");
* So you have output in 'reportOutput' . Then do what ever validation you want
We tried this option but if the string position changes when report runs for multiple times and we are getting error when we are trying to refer the variable where the string is captured. any suggestion ?
1 person found this helpful
Did you checked data in reportOutput ?
print it and see what it captured..
If its not capturing anything, use
String reportOutput = web.element("/web:window[@index='2']/web:document[@index='0']/web:body[@index='0']").getAttribute("text");
it is capturing entire ouput of the report, but we need to display in commetns only report total. So when we try to capture the report total in a variable and printing that value using info. But when report volume changes then it is failing to capture the correct value or failing by giving error unable to resolve variable
if you can give me the message u want to capture from report then i can help you.
Thanks Deepu, we have extended this code and able to capture the required string. Really good hint.. Thanks a lot.