Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to click on Link having * in the Text
#1
Not Solved Exclamation 
I have to write code to click on Link which contains "*" at end of text, example - TestLink *
I have populated these link names in the Datatable. Now to click on the link, I have the following code

'*** get link name
Code:
strLinkName = datatable.value("Global","LinkName")

'**** check the link Exist
Code:
If Browser("XYZ").Page("XYZ").Link("text:=" & strLinkName, "html tag:=A").Exist Then
Browser("XYZ").Page("XYZ").Link("text:=" & strLinkName, "html tag:=A").Click
Else
msgbox "Link Not Found"
End if

This code works fine for strLinkName= Test Link ,but fails when name has "*" at the end , like strLinkName= Test Link *

Please suggest where I missed something, I have few links in my test app, which needs to clicked to perform next function.
Thanks
Neel
Reply
#2
Not Solved
What is the error you get?
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
I tried to debug, it doesn't recognize the Link Name with the "*" and skips to the Else statement. and then Comes out of the Test run. I thought to add all the links in OR and then in the innertext property have the Test Link * replaced by RegEx Test Link \*, this works while using it with Object Spy.

let me know, another approach to acheive this.
Thanks
Neel
Reply
#4
Not Solved
Instead of using CLICK try to use NAVIGATE
Browser("XYZ").Navigate("Link in the data table")

Try this.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  how to randomly Select any category link and randomly click on one of its options ? sharavan 0 2,827 11-18-2014, 12:24 AM
Last Post: sharavan
  How to click on a dynamic link on a website Geekgirl 3 4,239 11-28-2013, 11:53 AM
Last Post: Jay
  Unable to click on moving text in a website Akhila 4 3,799 07-18-2013, 02:38 PM
Last Post: tanyamrz
  Read text from text file and save it into a variable in qtp arpan 3 12,101 06-19-2013, 08:34 PM
Last Post: arpan
Sad Not working if not hard coded (web link).click dlaureano 2 2,736 02-11-2013, 12:57 PM
Last Post: ravi.gajul

Forum Jump:


Users browsing this thread: 1 Guest(s)