I have web application and I want to get text from a page.
When I submit a order, I get an error message on the page.
NOTE: I DO NOT get a popup.
I do not want to put this message in the Object Repository.
Is there a way I can get all the text from the Browser Page and parse them and search the error message that I am looking for?
Please suggest the better way to handle this.
you could try:
</font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">var = Browser("brwosername".Page("pagename".getvisibletext
if instr(0, var, "Some Know Error" > 0 then
msgbox "Expected Error Message Present"
msgbox "Expected Error Message Missing"
end if</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">
I'm not a complete idiot - some parts are missing.
Browser does not support this Method, GetVisibleText.
Here is the Error.
Object doesn't support this property or method: 'Browser(...).Page(...).getvisibletext'
Is there a ClipBoard method?
Thanks for your reply.
The best way for handling such dynamic texts is to go for webtable.
Try to identify the webtable and particular cell(row, column)...then try to fetch the data from the cell.
Window("text:=" & ".*Internet Explorer").GetVisibleText()
Look at http://www.qaforums.com/ultimatebb.p...;f=20;t=003572
There is solution from Dima -
how to identify IE Window by hwnd
You can use a very simple code to get all the text that is displayed on the page
DisplayedText = Browser("brwosername").object.document.all(1).oute rText
Buy the NEW QTP Descriptive Programming Unplugged Book
** Download QTP Unplugged 2nd Edition eBook for FREE **