Forum Discussion

seth's avatar
seth
New Contributor
4 years ago
Solved

How to locate a component in nested shadowroots -- polymer in electron

Hi everyone!  I'm just dipping into TestComplete and I'm not having much luck figuring this particular issue out.  My project is a polymer/redux front end thats wrapped in Electron.  I'm trying to write some automated tests but am having a problem digging buttons and other components buried within nested shadowroot nodes.

 

I have enabled support for web components in Web Testing and I can get properties for objects that are one shadowroot deep, but cannot get any properties for objects deeper than that first shadowroot node.  The result I get back is that the object doesn't exist, though it most certainly does exist and function for the user.

6 Replies

    • seth's avatar
      seth
      New Contributor

      Good morning Sonya and thanks!  I actually found that NameMapping is useful but the nameMapping engine doesn't always locate the object and assign a name.  I've found mini work arounds but I think as I have to get deeper into the document, those workarounds won't work anymore.

       

      My best workaround so far is to match the properties CustomObjectTypelook with innerHTML under the Chrome properties in Advanced view within Object Spy.  This also requires me to search for the parent object by FullName, which gets a little ugly.  If there is a better, faster, smarter way, I'd love to hear it  🙂