Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Regular Expression in Desc programming
#1
Not Solved
I have to handle city names using regex

This piece of code works for single word city names
like Boston,Austin

--working for single word city
Code:
Browser("Hotels").Page("Hotels").Link("text:=Hotels in .*").Click

If I have city names with 2 words or with . it blows up.

Norfolk-Virginia Beach
Tampa-St. Petersburg
Bergen-Passaic
Riverside-San Bernardino
Orange county

Please some one help me with this how to write for the above mentioned cities.

Code:
Browser("Hotels").Page("Hotels").Link("text:=Hotels in .*").Click
Reply
#2
Not Solved
Above stmt should work, what was the error you are getting
Reply
#3
Not Solved
I'm guessing you are getting the "object's description matches more than one of the objects currently displayed in your application" error since you are not using more than one identification properties. Usually, you want to at least include "html tag", then if the text property of "text:=Hotels in .*" matches all of the "Hotels in" links on the page, you have to pick out which one you want to click with the "index" property. This will click the first "Hotels in" link:

Code:
Browser("Hotels").Page("Hotels").Link("html tag:=A", "text:=Hotels in .*", "index:=0").Click
Reply
#4
Not Solved
In addition to the previous comment, try this:

Code:
Browser("title=.*").Page("title:=.*").Link("name:=xxxx", "index:=0").Click
Reply


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

Forum Jump:


Users browsing this thread: 1 Guest(s)