I have something like Window("Microsoft Excel - Pivot Table 76").Window("Query Refresh").Click x,yThe problem is every time the window name changes. I know regular expression can be used but can anybody help me telling how?

Showing Answers 1 - 3 of 3 Answers

akothuru

  • Sep 9th, 2008
 

Applying Regular exeression on Window object is difficult. Other OS windows will also be recognized as window object. It could not be good practice, if atleast partial window text is not unique for the window. Instead, check the unique preoprty values of the window object of your application. If you know that the partial window propery is unique there might be a chance to recognise the object.
I used Descriptive programming here.
E.g.
Window("regexpwndtitle:=Flight.*").WinButton("window id:=5").Click 'Open order
Here we applied partial regular expression.
If you use full regular expression, if can't able to recognize the object.
Window("regexpwndtitle:=.*").WinButton("window id:=5").Click 'Open order button
it Gives pop up message, 'can't find object.'

Here, to recognize the window, I used 'window id' property. it seems as unique. So i used this property.
E.g:
Window("window id:=2885913").WinButton("window id:=5").Click 'Open order button

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions