Forum Discussion

huabing's avatar
huabing
Occasional Contributor
25 days ago

can not identify prompt by using Object Spy

run Edge as manager(administrator) role can identify prompt by Object Spy, but run Edge as sysoptest(administrator) role can not identify prompt( can identify normal elements), how to solve this?

confirm. alert or other prompt can not be identified by Object Spy.

TestComplete version 14.93, edge version 87, tescomplete extension are all installed and enabled,web settings are all the same.

7 Replies

  • scot1967's avatar
    scot1967
    Icon for Champion Level 1 rankChampion Level 1

    TC needs to be 'run as administrator' to properly access objects for identification.  The access level of the current user can be different.  You may need to check with your IT department to enable this.  If you are logging into the test computer as different users with different access levels this could be causing the problem.

    https://support.smartbear.com/testcomplete/docs/general-info/configuring/testing-under-admin-account.html?sbsearch=Run%20as%20administrator

    TestComplete will run a web browser with the same privilege level it is assigned.  To launch a browser as a different user you could script a call to start your browser.  As you have found, testing with different privilege levels can be problematic and even unstable at times.   I hope this helps!  

    WshShell = Sys.OleObject("WScript.Shell");
    WshShell.Run("runas /user:StandardUser \"C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe\"");
    // Or...
    WshShell.Run("runas /user:StandardUser \"C:\\Program Files (x86)\\Microsoft\\Edge\\Application\\msedge.exe https://your-web-app.com\"");
    

     




  • huabing's avatar
    huabing
    Occasional Contributor

    Object Spy is able to identify standard web elements (such as those with IDs, classes, etc.) when using SYSOPTEST. It only fails to recognize elements like confirm, alert, and other prompts. So I So I don't think the issue lies with the TestComplete extension—it might be related to the object namemapping or something like configuration.

    • Hassan_Ballan's avatar
      Hassan_Ballan
      Icon for Champion Level 2 rankChampion Level 2

      This does not make sense as described.

      Are both "manager(administrator) role" and "sysoptest(administrator) role" on the same computer and using the same TestComplete project?

      1. If yes, why are you using two admin users and switching between?
      2. If no, are both computers running the same old versions of TestComplete 14.93 and Edge 87?

       

      Use the Object Spy https://support.smartbear.com/testcomplete/docs/testing-with/exploring-apps/object-spy/index.html to select the prompt object, and provide a screen shot of the "Object Browser" viewing such prompt:

      1. When manager(administrator) role is used and Object Spy can identify the prompt object
      2. When sysoptest(administrator) role is used and Object Spy can NOT identify the prompt object (you will need to navigate the Object browser structure manually)

       

    • rraghvani's avatar
      rraghvani
      Icon for Champion Level 3 rankChampion Level 3

      Are you referring to the browser dialog i.e.

      which TestComplete can identify the controls as

      or web app dialog?

      Again, TestComplete and the AUT need to have the same privileges. I'm not sure why you are using different user roles!?

       

      • huabing's avatar
        huabing
        Occasional Contributor

        The former, browser dialog. When I use Object Spy to drag the mouse to point to the object, it just keeps loading and shows "Searching for the object that is under the mouse cursor. Please wait..."

        When I navigate to Object Browser and use "MGRTEST" role to run Edge and identify the alert, it displays 

        But when I use "SYSOPTEST" role to run Edge and identify the same alert, it displays

        The "SYSOPTEST" role cannot identify the alert. But it can identify the normal element(id, class, etc.) So I'm confused.

  • Hassan_Ballan's avatar
    Hassan_Ballan
    Icon for Champion Level 2 rankChampion Level 2

    TestComplete, Extension, and Browser all need to be installed and run under same role.

    The manager(administrator) role is different from sysoptest(administrator) role, and I assume you installed TestComplete/Extension using manager(administrator) role and it is working for you as expected.

    If you intend to use TestComplete with sysoptest(administrator) role, I suggest that you uninstall TestComplete, reboot, and re-install TestComplete using that role. This should make it work for you.

    💬 If a response helped you out, don’t forget to Like it! And if it answered your question, mark it as the solution so others can benefit too.