Micro Focus QTP (UFT) Forums
Unable to click on moving text in a website - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: VB Scripting/Descriptive Programming (https://www.learnqtp.com/forums/Forum-VB-Scripting-Descriptive-Programming)
+--- Thread: Unable to click on moving text in a website (/Thread-Unable-to-click-on-moving-text-in-a-website)



Unable to click on moving text in a website - Akhila - 07-06-2013

Hi,

In a website "http://www.indianrail.gov.in/#" I need to find out link ""Revised Refund Rules w.e.f. 01.07.2013" and click on it.
I have written the code...it says link is found but not clicking on it.
What could be the reason?
Code:
Set oLink = Description.Create()
oLink("micClass").value = "Link"
oLink("html tag").value = "A"

Set listLinks = oPage.ChildObjects(oLink)
no_links = listLinks.count

str =  "Revised Refund Rules w.e.f. 01.07.2013"
For i=1 to no_links
arr =listLinks(i).getroproperty("innertext")
     If  instr(str,arr)>0Then
        If listLinks(i).Getroproperty("visible")=True Then
            print "link is found"
            listLinks(i).click
        wait 3
        End if

        Exit for
     End If
Next



RE: Unable to click on moving text in a website - kordirko - 07-09-2013

Try this code, it click on this link
Code:
Set oLink = Browser("title:=Welcome to Indian Railway.*").Page("title:=Welcome to Indian Railway.*").Link( "innertext:=Revised Refund Rules w.e.f. 01.07.2013.*")

If oLink.Exist then
          If oLink.GetROProperty("visible") Then
                print "Link is visible"
                oLink.Click
          else
                  print "Link exists but  is not visible"
          End If
    else
          print "Link does not exist"
End If



RE: Unable to click on moving text in a website - tanyamrz - 07-18-2013

Hi Akhila,
the problem was with your instring i have corrected that please check the below code.

Code:
Set oLink = Description.Create()
oLink("micClass").value = "Link"
oLink("html tag").value = "A"
Set oPage = Browser("title:=Welcome to Indian Railway.*").Page("title:=Welcome to Indian Railway.*")
Set listLinks = oPage.ChildObjects(oLink)
no_links = listLinks.count-1

str =  " w.e.f. 01.07.2013"
For i=0 to no_links
arr =listLinks(i).getroproperty("innertext")
      If  instr(arr,str)>0Then
         If listLinks(i).Getroproperty("visible")=True Then
             print "link is found"
              print arr
             listLinks(i).click
         wait 3
         End if
print arr
       Exit for
      End If
Next



RE: Unable to click on moving text in a website - Staff - 07-18-2013

Please ensure to include your code between [code] tags while asking or replying to questions. I have done this for you for this time.


RE: Unable to click on moving text in a website - tanyamrz - 07-18-2013

Thanks Sure will take care from next time Smile