Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Regular expression to identify browser with different Title slowing script execution
#1
Solved: 11 Years, 3 Months, 4 Weeks ago
Hi all,

I am new to this forum. I have to automate a web application in which user id becomed of browsers title bar, So its changing on each different login. If i am loging in with a user id say "PC-UK' it changes browser window title to "[ProjectConnect] :[PC-UK]-Windows Internet Explorer:" where projectconnect is my application name.

so to catter this issue and make my script executable for different user IDs I used regular expressions. for browser object my scripts local object repository below is the list of of properties for which i used regular expression.

1-title::"projectConnect*Windows Internet Explorer"
2-opentitle::"projectConnect*"
3-name::projectCentre* ( here i didn't entered double course does it metter for QTP)

Now if I execute my login test script after changing properties in above manner for different objects , script can be executed of browsers with different title bars than as mentioned above i.e. "[ProjectConnect] :[PC-UK]-Windows Internet Explorer:" . But it degrades perfomance and its taking a lot of time as compared to version of script nothaving regular expressions.Smile[/i]

please suggest is it normal or I am not using regular expressions properly.

second question is little silly but it is the way i lited RE for name property in 3rd point is it valid.

waiting for your welcome and advise you people can offer.
Reply
#2
Solved: 11 Years, 3 Months, 4 Weeks ago
if the window title is like "[ProjectConnect] :[PC-UK]-Windows Internet Explorer:"
use [ProjectConnect].*

Reply
#3
Solved: 11 Years, 3 Months, 4 Weeks ago
Do the Regular expression for one property and then try for it. ( try with title or name property)
Reply
#4
Solved: 11 Years, 3 Months, 4 Weeks ago
Thanks for your replies
I have tried both resolutions as suggested first I cahnged my regular expression for all fields including URL,TITLE,NAMe some thing like below as per field requirement
"[ProjectConnect] :[PC-UK]-Windows Internet Explorer:"
In second case I removed regular expression at all from all fields except” title” but even than my script execution is slow.
Once script executioin is complete Test results shown as in attached screenshort. From my test results it seems I am on a wrong track as there are lot of warnings. These are description mismatch warnings you can see the attached image. These warnings are due regular expression or I need to run this script in maintenance mode.

I am getting confused what the benifit of regular expression then. Becuase one of the script where i didn’t used regular expression at all running on a different project with different URL and browser title bar absolutely fine.


Attached Files Image(s)
   
Reply
#5
Solved: 11 Years, 3 Months, 4 Weeks ago
try the title as '.*Windows Internet Explorer.*'
also regularise your url too.

Reply
#6
Solved: 11 Years, 3 Months, 4 Weeks ago
Hi,

may i know what all properties you have used to identify your Browser object.
check in object identification Settings.


Thanks
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Need Any digit in xpath path using Regular expression Priyam 1 3,496 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,361 04-09-2015, 01:56 AM
Last Post: sarahq49
  Regular expression and script optimisation Padmavathy 1 3,831 03-30-2015, 11:46 AM
Last Post: supputuri
  Regular expression in descriptive programming testernc 1 16,579 12-08-2014, 06:38 PM
Last Post: anshika.agarwal
  need a regular expression. anu05446 0 3,123 11-26-2014, 03:00 PM
Last Post: anu05446

Forum Jump:


Users browsing this thread: 1 Guest(s)