Micro Focus QTP (UFT) Forums

Full Version: Window Name Change Every time
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
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]
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.*
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
Hi,

Which value is keep changing is it only numeric or also string, please be clear then I can help you better
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.
Just use *.locked

this should work
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]
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
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.
Help me!!! Please!!
Pages: 1 2