Forum Discussion

Gordian's avatar
Gordian
Occasional Contributor
11 years ago

Can't see objects on "chrome://settings" page

I have TC 10.20 and Chrome 34.

With the object spy I'm able to see objects in my application so I know the extension is working.  However in screens like "chrome://settings" or Chrome security certificate warning page I can only see the top level window for the tab.  I can't see any objects inside of the page.



The WndCaption of the page is "Chrome Legacy Window".

The WndClass is "Chrome_RenderWidgeHostHWND".

The FullName is : Sys.Browser("chrome").BrowserWindow(0).Window(<WndClass>, <WndCaption>,1)





So what is the trick for seeing things inside of these legacy Chrome windows?  I need to be able to click the "Proceed anyway" button on the security certificate warning page in Chrome.  IE and Firefox aren't having this issue.


  • Hi Thomas,


     


    This is one of the Chrome specifics listed here:


    For security considerations Chrome refuses all extensions to inject code into its internal pages (about:*, chrome:*). Because of that, internal pages, like the new tab page, the extension manager, the download manager, the history page and so on, are not accessible to TestComplete.


     


    You may try playing with Chrome command-line parameters to accomplish your task - look at the --disable-web-security - parameter.


    The list of all parameters you can find here.


     

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Thomas,


     


    This is one of the Chrome specifics listed here:


    For security considerations Chrome refuses all extensions to inject code into its internal pages (about:*, chrome:*). Because of that, internal pages, like the new tab page, the extension manager, the download manager, the history page and so on, are not accessible to TestComplete.


     


    You may try playing with Chrome command-line parameters to accomplish your task - look at the --disable-web-security - parameter.


    The list of all parameters you can find here.


     

    • meenakshiyadav1's avatar
      meenakshiyadav1
      Contributor

      Hi Tanya,

       

       

      We are facing the same issue while accessing our application with Chrome.We are geting Certificate error page . we need to click on Advance and Proceed Link. but we are not able to get these object added. Test complete can only read till Legacy window not any child object. We have also tried looking at source code by doing F12 so that we can aceess it using Xpath ,even source code is not visible.

       

      I have tried Chrome command-line parameters  --disable-web-security and --allow-file-access-from-files . But this is not helping me. Test Complete is still not able to recognize proceed link on the page.

       

      Can you please suggesst something.

      • von_bailey's avatar
        von_bailey
        Contributor

        I have gotten around this by using the Wait command to search for whatever can be mapped and then doing a click command on the actual coordinates of the link/button that I am attempting to access.  For example, the chrome settings page will map to "Sys.Browser("chrome").Page("chrome://settings/")", so I do the following in Javascript to disconnect the current account logged in.

         

        code starts

        ********************
        setPage=Sys.Browser("chrome").WaitPage("chrome://settings/",1000)

        if(setPage.Exists)

             {// The "Disconnect your Google Account" button is located at the 269,133 coordinates, so...

               setPage.Click(269,133)

              }

        ********************

        code ends

         

        This code recognizes that the correct page is displayed and then it clicks on the coordinates in which to initiate the correct button.  I have found this works for all the chrome page objects.  

        When using this process, be sure to take into consideration messages that chrome adds that might change the coordinates.  An example would be using this method to clear the browsing data.   After the first time you use this process, chrome will add one of their messages that tell you that incognito mode might come in handy next time.  That message pushes all the objects down the screen and maybe out of any coordinates you have hardcoded.  So you might want to add another code of line with alternate coordinates and click both of them to make sure you get where you want to go.  It's a bit more time consuming as you have to find coordinates instead of objects, but it works.

        Hope this works for you.