Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to find the number of clicks on particulat link
#1
Solved: 11 Years, 3 Months, 2 Weeks ago
Hi All,
Scenario:
I have a one link called "Data Name" under this i could see some 200 data field values . By default all these field values shown in ascending order and when u click on this link manually page refreshes and still it will show the data fields in ascending order(Note: Here number of clicks on this link is "one" as of now) and by click on this link once again then the data field values will be shown in descneding order(Note: Here number of clicks on this link is "two" as of now)

Query: Here i need to find the number of clicks on a link "Data Name"
by this way i can put this logic in my code (Ex: if number of clicks are even then it will display in descending order, if number of clicks on this link are odd number then i could consider that displaying of fields are in ascending order

Please help in this regard to find the number of clicks on a particular link
Reply
#2
Solved: 11 Years, 3 Months, 2 Weeks ago
take a variable to store the click counter say iClkCnt set value default as 0, and on every link.click increase this with one( iClkCnt = iClkCnt +1)
in this way you will get the count of link clicked and put your logic

Reply
#3
Solved: 11 Years, 3 Months, 2 Weeks ago
Could u please explaing with clear example using any script
Reply
#4
Solved: 11 Years, 3 Months, 2 Weeks ago
Hope this will help you
Code:
Dim nClkCnt
nClkCnt = 0

Browser("Browser").Page("Page").Link("Link1").Click

nClkCnt = nClkCnt + 1

nRem = nClkCnt mod 2
If  nRem = 0 Then
    msgbox "Click count is Even- displayed in descending order"
else
    msgbox "Click count is Odd -displayed in ascending order"
End If

Reply
#5
Solved: 11 Years, 3 Months, 2 Weeks ago
Thanks alot, i have got the idea with this solution and i will implemet it in my code...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)