cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with .Find method, and explicitly locating web objects without NameMapping

Highlighted
Contributor

Need help with .Find method, and explicitly locating web objects without NameMapping

Hello all,

   I am coming from the world of UFT. I am watching a video series on TestComplete. From an example I am trying to use the Find method to click on an object. My test fails with the error Unable to find the object Sys.Browser....

I have been able to use ObjSpy on this open IE browser to get the property and property value I want the script to locate. So I know - or, atleast it seems TC can see the browser since I can spy objects. So why it fails when i run the test is confusing me. here is my code:

 function Test2()
{
pbi = Sys.Browser("iexplore").Page("https://app.powerbigov.us/home").Find("contentText", "Workspaces", 60, True);
pbi.Click();
}

 

Pretty simple. 

Any help w this is appreciated.

2 REPLIES 2
Highlighted
Community Hero

Re: Need help with .Find method, and explicitly locating web objects without NameMapping

Close all your instances of IE (double check it in Task Manager), then open the one you want to test and run your test again.  Let's see if TestComplete is getting confused with too many browsers open.

 

I think this is actually a timing issue but let's eliminate this first.

Community Hero

Re: Need help with .Find method, and explicitly locating web objects without NameMapping

Yes it is a timing issue and because of that you should not use the method "Find" on the Page object.

Please use the page NativeWebObject.Find instead and it will work every time.

Look at the "NativeWebObject" in the documentation.

 

Hope that helps

-Lino

New Here?
Join us and watch the welcome video:
Announcements
Script Wanted
A new challenge is here!

Create a function to drag one element to another for the TechCorner tag!

Will you dare to take the challenge?


Scripts created in July:
- Passing custom command-line arguments as a test parameter
Top Kudoed Authors