Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
regular expression for window title
#1
Not Solved
Hi,
I need to use regular expression for the starting string only in the window title name as it varies everytime.I am opening a video clip & its title varies everytime as I am opening different videos each time.For this,I have first parameterized the video name using DDT so that I can open several video files in one script itself.
But after executing the sciprt once,I need to close the video window & then re execute the script with 2nd video in the data table.For this I am requiring correct the regular exp.
i've tried various combinations but its failing everytime.
the string is as follows:
eg:abcd (Original Stream) ->For the first video
defg (Original Stream) ->For the 2nd video
i.e. the first string varies everytime & 2nd string remains same.There is a space between two strings which doesn't vary.
Can anyone plz tell me what expression I can use in order to execute my script?
Reply
#2
Not Solved
This might work for you

*.(Original Stream)
Reply
#3
Not Solved
tried above expression,but its failing. Sad
Reply
#4
Not Solved
test71,

can you give some properties your using before"abcd (Original Stream) ->For the first video
defg (Original Stream) ->For the 2nd video "

I am testing web application and on the same page i have lot of drop downs. To work find i have written the DP as

Code:
If QOALogin.Webtable("innertext:=SHIP to Location:.*").WebList("name:=.*").GetROProperty("disabled")=0 Then
   QOALogin.Webtable("innertext:=SHIP to Location:.*").WebList("name:=.*").Select 1
  End If
Wait(3)  
If QOALogin.Webtable("innertext:=SHIP to Contact:.*",index0).WebList("name:=.*").GetROProperty("disabled")=0 Then  
   QOALogin.Webtable("innertext:=SHIP to Contact:.*",index0).WebList("name:=.*").Select 1
  End If    
  Wait(3)

Please use webtable(if u get webtable when you spy) and then regular expression.

Please let me know your result
Regards
Raj
Reply
#5
Not Solved
raj,
I didn't get you...
You've written "can you give some properties your using before"abcd (Original Stream) ->For the first video ,defg (Original Stream) ->For the 2nd video "
What do you mean by this? And which webtable are you asking me to use?I am not working on a web application.Its a standalone application in VC++.
I have created a data table using DDT to input the video names in the table.Now when one video is opened,script is run on that & that video is closed2nd video from the data table is taken,but when it comes to close this clip,script fails,because the statement contains name of the previous video clip.Thats why I need to use regular expression for this video clip name,so that the script will not fail.
Reply
#6
Not Solved
test71,

what i was suggesting you is when you spy on the object you will get some hierarchy right. pls use the unique property.

The example i have given is for web application. in web application if you use spy the u will get the hierarchy as
Code:
Browser().Page().WebTable().WebList()
so if the Weblist is same then you can put some unique property in WebTable. Then you can just use the regular expression for the object like "weblist"

Regards
Raj
Reply
#7
Not Solved
Raj,
when I spy on the window title, I am getting a hierarchy as
Code:
Window("abcd").Window("avenue (Original Stream)")
After this what should I do?I want to use reg expression for avenue (Original Stream),where only 'avenue' text will vary evertime I open new video window.
Can you please suggest me exact expression that I can use for this?

Thanks.
Reply
#8
Not Solved
I have two questions here
Is Window("abcd") same for both videos?
First video name is "avenue (Original Stream)" what is the name of second video name.pls give the exact name dont give as "abcd". And you have mentioned Window("avenue (Original Stream)"). is there two brackets?

Finally try this
Code:
Window("abcd").Window(".*(Original Stream)")

Let me know your results

Regards
Raj
Reply
#9
Not Solved
Following is an abstract from my script:
Code:
Window("Video State").WinMenu("Menu").Select "File;Open Clip...    Ctrl+O"
Window("Video State").Dialog("Open Video Clip").WinComboBox("Look in:").Select "Desktop"
Window("Video State").Dialog("Open Video Clip").WinListView("Look in:").Select "Video_clips"
Window("Video State").Dialog("Open Video Clip").WinButton("Open").Click
Window("Video State").Dialog("Open Video Clip").WinListView("Look in:").Select "movingcamVS"
Window("Video State").Dialog("Open Video Clip").WinButton("Open").Click
Window("Video State").Dialog("Open Video Clip").WinListView("Look in:").Select DataTable("Video_clip_name", dtGlobalSheet)
Window("Video State").Dialog("Open Video Clip").WinButton("Open").Click
Window("Video State").WinMenu("Menu").Select "Video;Repeat For Ever"
Window("Video State").Window("avenue (Original Stream)").Activate
Window("Video State").Window("avenue (Original Stream)").Close

In the last 2 statements I want to use reg exp for avenue (Original Stream).This will be the window title displayed for the video opened.Now in this,only 'avenue' will change for every video,(Original Stream) text will remain as it is.
I have created a data table with colmun name 'video_clip_name' in which I am giving the video clip names,so that QTP can open the videos one by one.
I have tried Window("abcd").Window(".*(Original Stream)")
But this doesn't work.Also tried to use reg exp in OR itself, with .*,but it gives error 'Cannot identify the object "avenue (Original Stream)" (of class window).Verify that this object's properties match an object currently displayed in your application.'
I am not getting what's wrong.. Sad

Thanks
Reply
#10
Not Solved
test71: In OR change it to .* (Original Stream)

Also don't forget to tick the use regular expression check box while changing the above value.
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Need Any digit in xpath path using Regular expression Priyam 1 3,469 10-05-2016, 11:05 AM
Last Post: Ankur
  Regular expression to read two words in lowercase, uppercase and with and without spa sarahq49 1 3,339 04-09-2015, 01:56 AM
Last Post: sarahq49
  Regular expression and script optimisation Padmavathy 1 3,783 03-30-2015, 11:46 AM
Last Post: supputuri
  Regular expression in descriptive programming testernc 1 16,545 12-08-2014, 06:38 PM
Last Post: anshika.agarwal
  need a regular expression. anu05446 0 3,106 11-26-2014, 03:00 PM
Last Post: anu05446

Forum Jump:


Users browsing this thread: 2 Guest(s)