Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to click on moving text in a website
#1
Not Solved
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
Reply
#2
Not Solved
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
Reply
#3
Not Solved
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
Reply
#4
Not Solved
Please ensure to include your code between [code] tags while asking or replying to questions. I have done this for you for this time.
Reply
#5
Not Solved
Thanks Sure will take care from next time Smile
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Moving Test Resource(ALM) to other Folder Bastian-31 0 1,660 09-18-2017, 12:24 PM
Last Post: Bastian-31
  "Continue to this website (not recommended)." Error we are getting kotaramamohana 7 28,597 07-21-2016, 09:55 PM
Last Post: Ranjith Nair
  Unable to click on the WebButton with specified Index srach84 2 4,291 03-31-2015, 04:36 AM
Last Post: srach84
  Unable to click on WebButton in WebTable srach84 1 3,100 02-09-2015, 09:07 PM
Last Post: arpan
  How to click on a dynamic link on a website Geekgirl 3 4,507 11-28-2013, 11:53 AM
Last Post: Jay

Forum Jump:


Users browsing this thread: 1 Guest(s)