Forum Discussion

Southpaw's avatar
Southpaw
Contributor
5 years ago

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

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    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.

    • LinoTadros's avatar
      LinoTadros
      Community Hero

      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