Forum Discussion

sedens's avatar
sedens
Contributor
2 years ago
Solved

Unable to run scripts using Edge as a TestedApps in TestComplete

Hi,

 

I have some scripts to run a web application in Edge chromium web browser however when I run the test it throws a "The object xxxx does not exist." 

 

The application contains 4 input fields and a button. The script attempts to populate each field with data and click the button however it does not recognize the objects. When I try to use the Object Spy, it does not recognize the objects either - just shows a red border to the browser window instead of the fields. 

 

I have added Edge as a TestedApps, Edge does contain the TestComplete extension and I have ticked * option in the List of accepted windows in Current Project Properties > Open Applications > MSAA section. All other suggested settings for Edge in the TC documentation has been set. 

 

TestComplete version = 15.44

Edge version = 106.0.1370.52

 

I used to be able to access the objects and spy the objects a while ago but now something has changed and I'm unable to run any tests using Edge. Any suggestions appreciated! Thanks.

  • Ah yes - you need to enable access to local files for the Extension. Go to the settings page for the Edge extension and enable access to file URLS : 

    Reload the page and they should be accessible.

     

11 Replies

  • hey sedens 

     

    TestedApps is used for Desktop and Native Mobile testing - to create a web test, you just need to have the browser open. 

    Can you make sure you only have one instance of the browser open at one time? Sometimes multiple instances of the browser cause ambiguity in identifying the "correct one" for TC to record over.

    • sedens's avatar
      sedens
      Contributor

      I do not have multiple instances of Edge open. The test script opens the browser using the following line of code in the script: 

      Browsers.Item[btEdge].Run(url);

       

      However when it gets to this line in the code where it tries populate the object with data, it fails to recognize the object: 

      browser = Aliases.browser
      page = browser.pageLogIn
      page.Wait()

      page.txtPersonID.SetText("12345")  <--- fails on this line because it does not find the txtPersonID object

       

      Using the Object Spy on the web application also does not recognize any individual object. It used to be able to put a red border around each field. It does work in Chrome and IE but not Edge.

       

      I removed msedge from the TestedApps and ran the test again - still does not recognize object. There is only one instance of the browser open. 

       

      Any other ideas?

  • Does the test log point you towards any reason why txtPersonID was not found?

     

    Does the same behaviour happen in a new/different project?

    • sedens's avatar
      sedens
      Contributor

      It works fine in Chrome and IE browsers for all TC projects. The Object Spy is also able recognize objects for those browsers for any project.

       

      It is Edge that is not recognizing objects at all - for any TC project - I believe this is because Edge is a Chromium browser and I read the documentation/comments in the SB community that you need to add Edge as a TestedApp. It did work for a little while but now it is no longer working. 

       

      The error logs reports the following: 

      Unable to find the following object when executing the SetText command:

      • sedens's avatar
        sedens
        Contributor

        Furthermore to my comment above, the web page itself is a HTML page with html tags. Not sure if that helps. 

    • sedens's avatar
      sedens
      Contributor

      Yes - I mentioned that in my initial post. It is enabled. 

      • sedens's avatar
        sedens
        Contributor

        I tried an experiment: I navigated to google.com in Edge and tried the Object Spy on it. It was able to recognize objects on the page so I think the culprit is the html page itself. The html page is a file on my desktop e.g. the URL to open the file in the Edge browser looks something like this: file://C:/Users/form.html 

         

        This html page contains a POST form method to pass data from the input fields to a web application that is online. If I access the web application I am able to access the objects on the page. It is the objects on the html file I am not able to access. 

  • Ah yes - you need to enable access to local files for the Extension. Go to the settings page for the Edge extension and enable access to file URLS : 

    Reload the page and they should be accessible.

     

    • sedens's avatar
      sedens
      Contributor

      Thank you so much. That worked! I've been banging my head for weeks on this.