User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 2 of 2
  1. #1
    New Member
    Join Date
    May 2015
    Post Thanks / Like
    0 Post(s)
    0 Thread(s)
    Total Downloaded

    Unable to Create and/or Use Visual Relations in Test

    I am trying to write a test in UFT 12.02. I am not a tester or a developer. This is a proof-of-concept. And if you put two-and-two together there, yes my company pays for a software license for software they do not use.

    I have a table with 4 columns, each row contains details about a report. In the left-hand column is a TEXT link to edit the report; in the right-hand column is an IMAGE link to view the report. So if the table has twenty links with unique text, it also has twenty links that all use the same image. For a given report, I need to find the unique text link on the left and then follow the corresponding image link on the right.

    I have used the Object Repository to link the image to the text, and when I preview the relationship it appears to be set up correctly. But I haven’t been able to find out how I am supposed to use this definition to help write a test.

    Instead I have been trying to follow examples online to establish this link programmatically. It is not working, and I am running out of ideas/resources. My task is to write a UFT test that finds the unique left-hand text (in a “Report ID” WebElement) and follows the corresponding right-hand image (“View Report”). But my current test is spitting out information to try to help me debug the problem rather than click the link. I create a set of objects based on the Description Object, but no items are returned, if I remove the line “oDesc("visual relations").Value = rc” then I get one item, the WebElement I am looking for. However if I remove the other three lines setting Values, I find lots of objects. I cannot seem to establish the link between the Report ID element I want and the image to the right of it. Any help is appreciated. Here is the current iteration of my test:

    varReportID = "5704"

    Set rc = VisualRelations.Create
    Set relation = rc.Add
    relation.relatedobjectpath = "Browser(""name:=Browser"").Page(""name:=Dashb oard "").Image(""name:=View Report"")"
    relation.relativeposition = micRelRight
    relation.setargument micrelinline, True

    Set relation = Nothing

    Set oDesc = Description.Create()
    oDesc("micclass").Value = "WebElement"
    oDesc("name").Value = "Report ID"
    oDesc("innertext").Value = varReportID
    oDesc("visual relations").Value = rc

    Set reports = Browser("Browser").Page("Dashboard ").ChildObjects(oDesc)

    ‘errors out here since this is empty
    varExist = reports (0).GetROProperty("visual relations")

    Print "Value of varExist - " & varExist
    Print "Type of varExist - " & TypeName(varExist)

  2. #2
    Advanced Member
    Join Date
    Aug 2004
    Wellington, New Zealand
    Post Thanks / Like
    0 Post(s)
    1 Thread(s)
    Total Downloaded
    I don't think you need a VRI.

    Could you just get the childObject from the table?

    1. You can GetRowWithCellText to find the row (you said that column one contains unique text),
    2. You know that the image link is in 4th column, and you know the object class.
    3. so getChildObjects(...) should be a pretty simple way to click the 'view report' image.

    ..assume that's what your goal is.

    ... just another Tester ...



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.11%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 09:49 AM.

Copyright BetaSoft Inc.