Forum Discussion

thePantz's avatar
thePantz
Contributor
5 years ago

Testing a chrome extension with TestComplete

Hello,

 

I'm trying to use TestComplete to test a Chrome extension that is currently in development. When I click on the icon it will display a popup like so:

 

As far as I know there is no way to reliably target and click the icon. Please let me know if there is.

Since the popup is actually another webpage (this is just how chrome extensions work) I tried to work around this by opening it by itself. You can do this by opening a url like chrome-extension://<extention-unique-id>/popup.html

 

So now I have a web page like this:

 

 

But for some reason, I cannot find the 'Take Screenshot' button in TestComplete.

It finds the page but it does not have any children

 

 

Here is the HTML for the page:

<html>
  <head>
        <style>
            button {
                white-space: nowrap;
                outline: none;
            }
        </style>
    </head>
    <body>
    <button id="takeScreenshot">Take Screenshot</button>
        <script src="popup.js"></script>
    </body>
</html>

 

Does anyone have any ideas/experiance testing chrome extensions? I came up with this method from this selenium post so I know it's possible

 

Thanks!