Micro Focus QTP (UFT) Forums
Window Name Change Every time - 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: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Window Name Change Every time (/Thread-Window-Name-Change-Every-time)

Pages: 1 2


Window Name Change Every time - gutocruz03 - 03-22-2012

Hi,

I'm having problems with a code.
I use a program on the windows in my company where I'll always creates a new item in it, it generates a new name for the window so I can not select that window and populate the data in this window. When I put QuickTest to run it crashes because they do not think this object in the repository.
How to work around this situation?
Could anyone give me a hand??

Example:
Code:
Window("Desktop").[b]Window("78979789754634 (locked)")[/b].Activate
[b]This name change = Window("78979789754634 (locked)")[/b]



RE: Window Name Change Every time - rameshrise3 - 03-22-2012

Hi,

Try Regular Expression, this is how you do

Open the object in OR, select the property that the name is stored for(may be text),
click on its value,
Click on Configure the value button to its right,
in Constant field, check Regular Expression and give the name as 789.*



RE: Window Name Change Every time - gutocruz03 - 03-23-2012

Tks for you help, but i have a doubt again!!

and my code, how i put this in my code to active screen?

Window("Desktop").Window("78979789754634 (locked)")[/b].Activate


RE: Window Name Change Every time - rameshrise3 - 03-23-2012

Hi,

Which value is keep changing is it only numeric or also string, please be clear then I can help you better


RE: Window Name Change Every time - gutocruz03 - 03-23-2012

every time I open this window appears:

78979789754634 (locked)

is always a random number and the word (locked).

I do not know if that's what you were wondering.

I'm from Brazil and sometimes a bit confusing English words. Sorry.


RE: Window Name Change Every time - rameshrise3 - 03-23-2012

Just use *.locked

this should work


RE: Window Name Change Every time - gutocruz03 - 03-23-2012

Do not work.
Maybe i do something wrong.
Can you sen me some pictures about this configuration.

Tks.

Look my code, what i have to change?

Code:
Window("Desktop").Activate
Window("Desktop").WinMenu("Menu").Select "Edit;<Item 5>"
Window("Desktop").Window("New Document").Type "99919999"
Window("Desktop").Window("New Document").Activate
Window("Desktop").Window("New Document").Type  micTab
Window("Desktop").Window("New Document").Type  micTab
Window("Desktop").Window("New Document").Type " "
[b]Window("Desktop").Window("99919999 (locked)").Activate[/b]



RE: Window Name Change Every time - sshukla12 - 03-23-2012

Hi,

I think after this line Window("Desktop").Window("New Document").Type " ".... ur new window gets open. use wait to let the window get displayed and have u updated the Object repository with the regular expression?

Regards,
Sankalp


RE: Window Name Change Every time - gutocruz03 - 03-23-2012

Do not work Sankalp.

Window("Desktop").Window("99919999 (locked)").Activate

when enter this part of the code, the error occurs.
He asks to check the window class.

Follow in attachment 2 images about my doubts.

please do not be angry with my doubts

Tks.


RE: Window Name Change Every time - gutocruz03 - 03-27-2012

Help me!!! Please!!