Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Square Bracket Issue - Regular Expression
#1
Solved: 10 Years, 8 Months, 4 Weeks ago
I'm testing an instance of Salesforce.com and have run into an issue. Our development team is using a numerical indicator inside a hyperlink to let the user know how many of "something" reside on the page that link takes a user to. My example is a link that takes the user to a page that has a list of names on it. The link itself reads: Call List [10]...this means that they have ten records on the call list page. Obviously as we test, that number could change to any value.

My problem is a simple one. Because the link itself has square brackets, I believe QTP won't let me use the regular expression feature on the link object. I've tried every way I know to change the text, innertext, outtertext and name of the object in the OR using the regular expression feature. A few that I've tried:

Call List*
Call List [*]
Call List \[\*\]
Call List [(*)]

...and many other variations.

I've even tried using some other expressions such as \w. No matter what I try, I can't get it to work. Does anyone out there have a suggestion? Usually when I get into a problem like this, it is something simple, but I've been trying to figure it out for hours.

The error I'm receiving: "Cannot identify the object 'LeftNav - Call List...'"

My line of code throwing the error:

Browser("salesforce.com - Unlimited").Page("salesforce.com - Unlimited").Frame("Frame").Link("Left Nav - Call List*").Click

I've attached a screen shot of my OR for anyone who is interested. It couldn't be more simple.
   

Thank you!
Reply
#2
Solved: 10 Years, 8 Months, 4 Weeks ago
As you think "Call List*" does not match all the words start with "Call List".

It means zero or more occurrences of that char... Actually it tries to match "Call Lis" or "Call List" or "Call Listt" or "Call Listtt" --> got it?

So what you need to do is "Call List.*" --> this will match all the words start with "Call List"
Reply
#3
Solved: 10 Years, 8 Months, 4 Weeks ago
As I thought, it was something very simple. Thank you so much, vIns. This has REALLY helped me. It worked perfectly.

Reply


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

Forum Jump:


Users browsing this thread: 1 Guest(s)