Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Webelement innertext is not case sensitive
#1
Not Solved
In my application I have two webelements having innertext as

1. veolia transport
2. Veolia Transport - (words V and T are uppercase here)

I have used below code to click the object that has innertext "Veolia Transport"
Code:
browser("index:=0").page("title:=.*").webelement("innertext:=Veolia Transport").Click
However I am getting an error saying "Description matches more than one object".

When I use below code then it is working,
Code:
browser("index:=0").page("title:=.*").webelement("innertext:=Veolia Transport","index:=1").Click

How to make sure that object recognition considers case sesitive.

Note: I want to avoid index property.

Thanks in advance!!

Regards,
Sandeep.
Reply
#2
Not Solved
The keyword is called "Regular Expression". Read about it and See if that helps.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#3
Not Solved
Hi Basanth,

Code:
The keyword is called "Regular Expression". Read about it and See if that helps.

Yes I have already tried to solve this using Regular Expression however I could not able to find solution for case senstive issue.

Regards,
Sandeep.
Reply
#4
Not Solved
Here is a start...build on this block !
Code:
Set myRegExp = New RegExp
myRegExp.IgnoreCase = True
myRegExp.Global = True
myRegExp.Pattern = "regex"
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#5
Not Solved
Sorry, I do not see any fix with the regular expression.

I need some fix with QTP based logic.

Regards,
Sandeep.
Reply
#6
Not Solved
May be you would like to try Descriptive Programming to get all the webelements, retrieve the innertext, compare and find your desired object.

Reply
#7
Not Solved
I cannot change the actual code or logic due to some dependancy.

Is there any way to fix this using QTP regular expressions (not VB logic) or any other qtp settings?

Regards,
Sandeep.
Reply
#8
Not Solved
Apart from index is there any other unique property for that webelement? then you can use that..
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Select case is not being executed in a Function Anupama 1 1,600 05-25-2018, 11:15 AM
Last Post: Anupama
  Using Range in Select Case Statement Studymode 0 1,498 12-14-2017, 06:18 PM
Last Post: Studymode
  Using Select Case Statement Studymode 0 11,704 12-13-2017, 05:55 AM
Last Post: Studymode
Exclamation WebElement("WebElement").Click is not working sia sharma 7 23,953 09-28-2016, 08:58 PM
Last Post: supputuri
  Case changes while reading values from inbuilt datatables krishnakittu03 3 2,964 04-28-2015, 11:34 AM
Last Post: kbhargava505

Forum Jump:


Users browsing this thread: 1 Guest(s)