Micro Focus QTP (UFT) Forums
Ignoring a dynamically generated web window title - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Ignoring a dynamically generated web window title (/Thread-Ignoring-a-dynamically-generated-web-window-title)



Ignoring a dynamically generated web window title - Cecil - 01-23-2008

Hi

I have a recorded test that involve downloading a PDF report. The problem is each time the report is generated, it has a different number and this number is incorporated to the window's title. And it looks like when I ran test, because the window's title is different the test is failing. I was thinking that if I can get the test to ignore the title of the window, the test might run fine. Can any body help.

Cheers
Kathy


RE: Ignoring a dynamically generated web window title - Ankur - 01-23-2008

Go ahead and remove the title from the object identification settings.

if you don't want to remove/or if there is a problem in running the test , you can use regular expression for the changing piece of text in title


RE: Ignoring a dynamically generated web window title - Cecil - 01-31-2008

Hi Ankur

I have tried you suggestion and remove the title of the window (text property), but it doesnt seem to work. I have attached a screen shot on what I did and the error message I got when running the edited test script.

[The error message I got was:
1. Step Name: Save - Step Failed - Save Cannot find the "Save" object's parent "0% of Questionnaire-17490571.p" (class Dialog). Verify that parent properties match an object currently displayed in your application. Failed 31/01/2008 - 11:31:14

2. Step Name: 0% of Questionnaire-17490571.p - Step Warning - 0% of Questionnaire-17490571.p Object's physical description:
Text =
simclass = #32770
Native Class = #32770
miccommentproperty =
is owned window = 0
is child window = 0
Warning 31/01/2008 - 11:31:15 ]


RE: Ignoring a dynamically generated web window title - Ankur - 01-31-2008

well, it seems you only removed the value of title from object identification settings. QTP here will try to search for a blank value of title. What I meant was to remove title property as a whole from your settings.

OR of that doesn't work use regular expressions :

I assume the no in "Questionnaire-17490571.p" is changing. Click on the value property of title and modify it to Questionnaire.* and then check the use regular expression box


RE: Ignoring a dynamically generated web window title - Cecil - 02-01-2008

Hi Ankur

I have now removed the "text" property. But it still doesn't work. Though after a closer inspection, I notice that there might be another reason it failed. It seems like when I run the test script, the pop up (PDF report) doesnt behave the same way as when I recorded the script.

When recording, when I click the link to download the report link, it opens a blank separate window then it prompts me to either Open/Save/Cancel and after I clicked on Save it prompted me to choose the location to save this file.

When running the test script, it seems like, the whole prompt step didn't happen. It opens the blank window bit then the window closed without prompting to Open/Save/Cancel (then the browse for location step). So when the script tries to execute the Save-ing part and the browse location part, there dialogue boxes doesn't exist.

What can I do to ensure the test script run still come up with the 2 prompts?


Cheers
Kathy