在QTP中动态构建URL

发布于 2024-08-12 14:33:33 字数 371 浏览 4 评论 0原文

我和我们的一位测试团队快速浏览了 QTP。

我们已经弄清楚了一些基础知识,例如记录测试、使用输出值捕获文本、放入检查点等。

但是,我不知道如何执行以下操作......

我们有一个用户填写的网络表单并提交。这将创建一个项目并在数据库中为其分配一个 ID。我们可以捕获这个ID。

随后的页面将显示所有项目的列表,以及可用于打开特定项目的链接。这是网页上的简单超链接。

如何:

  • 检查页面上是否存在具有创建步骤分配的 ID 的链接?
  • 点击那个链接?

我确信这一定是可能的,但到目前为止我一直在努力摸索这个工具,所以这是一个无耻的请求帮助,让我不必研究文档。

谢谢。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

眼眸里的快感 2024-08-19 14:33:33
  1. 快速了解一下QTP中的Web GUI识别原理。进入描述性编程部分。

  2. 查找 QTP 中链接对象的帮助。

  3. 使用描述性编程定义目标 Link 对象。
    应该是这样的

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

  4. 使用

    boolRC = objTargetLink.Exist(0)

    检查您的链接是否存在。

  5. 使用

    sURL = objTargetLink.GetTOProperty("url")

    检索实际的 URL。您可以用同样的方式获取其他属性。

  6. 使用objTargetLink.Click 单击链接。

附言。不过,功能测试自动化有所不同。
要求您的测试团队阅读自动化框架和自动化要求。
我的博客上有一些东西。
http://automation-beyond.com/2009 /06/06/qa-test-automation-requirements-usability/

谢谢,
阿尔伯特·加里耶夫

http://automation-beyond.com/

  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/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文