English 中文(简体)
Dynamically building a URL in QTP
原标题:

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.

最佳回答
  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/

问题回答

暂无回答




相关问题
Selenium not working with Firefox 3.x on linux

I am using selenium-server , selenium rc for UI testing in my application . My dev box is Windows with FireFox 3.5 and every thing is running fine and cool. But when i try to run selenium tests on my ...

Best browser for testing under Safari Mobile on Linux?

I have an iPhone web app I m producing on a Linux machine. What s the best browser I can use to most closely mimic the feature-limited version of Safari present on the iPhone? (It s a "slimmed down" ...

Code Coverage Tools & Visual Studio 2008 Pro

Just wondering what people are using for code coverage tools when using MS Visual Studio 2008 Pro. We are using the built-in MS test project and unit testing tool (the one that come pre-installed ...

Is there any error checking web app cralwers out there?

Wondering if there was some sort of crawler we could use to test and re-test everything when changes are made to the web app so we know some new change didn t error out any existing pages. Or maybe a ...

热门标签