Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
recording random link part
#2
Not Solved
It's not clear from your message exactly what you are trying to do, but if I understand you have a page that contains 101 links that all have the format:

KP(n)

Where n is a number from 0 to 100. You are then trying to randomly select and click on one of those links. If this is an accurate description of your issue then you can solve it with some Descriptive Programming:

Code:
Browser("browsername").Page("browserpage").Link("text:=KP(" & RandomNumber(0, 100) & ")").Click

This basically tells QTP to identify a link object with the text value of KP(n), with n being a random number from 0 to 100 and click that link. If there is any other text in the link then this will likely fail. Additionally if there are not 101 links on the page then you run the risk of looking for a link object that does not exist.

Plese respond with a more clear description of the issue if this explanation is insufficient.
Reply


Messages In This Thread
recording random link part - by logistix - 11-21-2008, 03:21 AM
RE: recording random link part - by rnickerson - 12-13-2008, 04:16 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Part of parameters missing when passing between actions skumar007 1 2,848 10-10-2014, 02:00 AM
Last Post: skumar007
  Create a random number starting with an alphabet QTPmate 4 3,859 07-31-2014, 09:29 AM
Last Post: QTPmate
  Random Values from Drop-Down profqa 5 5,714 12-06-2013, 09:01 AM
Last Post: basanth27
  Creating Random String SomeIntern 0 4,781 08-21-2013, 09:10 PM
Last Post: SomeIntern
  Random Number generator and verification problem jinnah 4 10,043 09-28-2012, 04:03 AM
Last Post: jinnah

Forum Jump:


Users browsing this thread: 1 Guest(s)