Question

I've been taking a quick look at QTP with one of our test team.

We've figured out some basics like recording a test, capturing text using output values, putting in check points, etc.

However, I can't figure out how to do the following...

We have a web form which a user fills in and submits. This will create an item and assign it an ID in the database. We can capture this ID.

A subsequent page then shows a list of all items, with a link available to open a specific item. This is a simple hyperlink on a web page.

How do I:

  • Check that a link exists on the page with the ID assigned from the creation step?
  • Click that link?

I'm sure that this must be possible, but I've been struggling grokking the tool so far, so this is a shameless cry for help to save me from having to study the docs.

Thanks.

Was it helpful?

Solution

  1. Quickly look on Web GUI recognition principles in QTP. Get to the descriptive programming part.

  2. Find Help for Link object in QTP.

  3. Define your target Link object using descriptive programming. It should be something like

    Set objTargetLink = Browser("title:=...").Page("title:=...").Frame("title:=...").Link("id:=target_id")

  4. Use

    boolRC = objTargetLink.Exist(0)

    To check if your link exists.

  5. Use

    sURL = objTargetLink.GetTOProperty("url")

    to retrieve the actual url. You may get other properties the same way.

  6. Use objTargetLink.Click to click on the link.

PS. Functional Test Automation is something different, though. Ask your testing team to read about automation frameworks and automation requirements. I have some stuff on my blog. http://automation-beyond.com/2009/06/06/qa-test-automation-requirements-usability/

Thank you, Albert Gareev

http://automation-beyond.com/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top