Highlighted
Super Contributor.
Super Contributor.
288 views

scope of Object Reopository (local) objects

Jump to solution

I'm having trouble with the scope of Object Reopository (local) objects:
I inherited the testing role from a very experienced UFT guy, who left where I work and now lives in another state.
He left a fine set of test for the previous version of the Web APP, which I'm migrating to be the Regression Tests for the new version due to be released into the field.
I replicated the previous tests (with all Actions and the Function Library) but with the new versions's web objects captured into the Object Repository (local).

The trouble is that when the running focus shifts to a public function in the Function Library, it crashes with a complaint that the web object is not in the local Object Repository.
It seems that the Object Repository (local) objects that are seen when the running focus is at the "Action" level, are not seen when the running focus is inside the public function inside the Function Library.

Is there a remedy to this scope issue?

0 Likes
1 Solution

Accepted Solutions
Highlighted
Honored Contributor.
Honored Contributor.

From what I understood, you are using the same tests and libraries, but you added a new OR for the new version of the App. The error message you are seeing does not look like a scope issue, it is a object mismatch or object not found issue.

Compare the objects within the OR of old test and the OR of new test. The objects must match by type and also by name.

Meaning:

old script has a step: Browser("B").Page("P").WebButton("Save")

The OR, for the new script, must have Browser named B, page named P, and WebButton named Save.

If the object names are different or the object types are different then you will see error message like the one you have posted. 

So, please check your local repository and see if the objects are present, they should match both by class and name. Meaning, if button has changed into a link, but has the same name. It will still not work, script is looking for a button named 'save'.

Also, if you have issues resolving it, please attach screenshot of old and new repository, so that others can help.

GoScriptLESS Create tests in seconds using UFT View demo and additional info at scirptlessautomation.com

View solution in original post

2 Replies
Highlighted
Honored Contributor.
Honored Contributor.

From what I understood, you are using the same tests and libraries, but you added a new OR for the new version of the App. The error message you are seeing does not look like a scope issue, it is a object mismatch or object not found issue.

Compare the objects within the OR of old test and the OR of new test. The objects must match by type and also by name.

Meaning:

old script has a step: Browser("B").Page("P").WebButton("Save")

The OR, for the new script, must have Browser named B, page named P, and WebButton named Save.

If the object names are different or the object types are different then you will see error message like the one you have posted. 

So, please check your local repository and see if the objects are present, they should match both by class and name. Meaning, if button has changed into a link, but has the same name. It will still not work, script is looking for a button named 'save'.

Also, if you have issues resolving it, please attach screenshot of old and new repository, so that others can help.

GoScriptLESS Create tests in seconds using UFT View demo and additional info at scirptlessautomation.com

View solution in original post

Highlighted
Super Contributor.
Super Contributor.

Thank you, GoScriptless1, for your reply.

To make this UFT Test Solution more "interesting", the Web APP is built to run in FireFox, while the previous tester used Internet Explorer (IE) to launch a web page TestSetup.html that uses tables and drop-down menu boxes (that UFT OR (local) interprets as WinList) to select a server (or all) and to select which test (or all) to run, and other such parameters.

You are right about the OR (local).
The scripts use statements like: Browser("B").Page("P").WebButton("Save")
When I use Resources --> Object Repository --> Object --> Add Objects to Local . . .
to capture the web objects by clicking on items in the IE (TestSetup.html)
the pop-up window Object Selection - Add to Repository  shows:
 - Browser : TestSetup
   - Page : TestSetup
      - WebTable : Pick a Server
        - WebList : SelectServers
which is great! Exactly what I need.

The trouble is that when I click [OK] on the Object Selection - Add to Repository dialog box, and it adds the captured Objects to the OR (local), it is no longer
Browser("TestSetup").Page("TestSetup").WebTable("Pick a Server").Weblist("SelectServers") !
The OR (local) only shows one level of TestSetup, which I guess is the Browser( ) level, and below that, the blue dots for the WebTable and a List icon for the WebList( ) drop-down menus.

So, my problem is now, the Objects captured from IE(TestSetup.html) in the OR (local) no longer match what the script statement Browser("B").Page("P").WebButton("Save")  actually says. They lose a level in the object structure.

The Objects that I captured from FireFox had the Browser("B").Page("P").{stuff} which I added to the OR (local) survived intact: Browser("B").Page("P").{stuff}

So, how can I get objects captured from IE to survive intact when I add them to the OR (local) ?

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.