WinAppDriver icon indicating copy to clipboard operation
WinAppDriver copied to clipboard

PageSource for application differs on VM vs. full computer

Open grpeacock opened this issue 7 years ago • 0 comments

Background I've been using WinAppDriver to automate the workflow testing for a custom extension for Azure Data Studio, which is an Electron app (normally, I'd use Selenium for this, but iframe switching within a shadow DOM is not supported).

Issue When attempting to run the tests on a CI/CD VM (using Hyper-V), I found that the page source generated by WinAppDriver was a small fraction of the page source generated on my development machine. Then, I found out that running the inspect tool on the VM at the same time of test run changed the page source further - into a 3rd different page source. The 3rd page source is actually more complete than what is available on my development computer, which returns the same page source whether inspect is open or not. Since the page model for my tests is written off of XPaths, nothing is able to be found when run on the VM.

I've attached exported page sources for each case. For each, I trimmed out information that is not uniquely identifying for elements.

PagesourceLegible - Dev computer.txt PagesourceLegible - VM no inspect tool.txt PagesourceLegible - VM with inspect tool.txt

Troubleshooting I've currently ruled out:

  • OS version - happens on both Windows 10 and Windows Server 2016 VMs
  • WinAppDriver versions
  • ADS versions
  • Windows SDK versions
  • Connecting to WinAppDriver locally on VM or over network

Hypothesis: It seems that the behavior is consistent across all VMs and across all full computers I've tested on. Could there be something going on with how the VM generates windows when connected to via remote desktop? Although, if that's the case, how are other uses in CI/CD not having similar issues? Could it be related to a combination of being Electron on a VM?

Question Any suggestions on how to normalize the page source? Preferably, the 3rd page source (VM while inspect is open) has the most information, but I can use some "hacky" workarounds to build a page model from what is available on my development machine if needed.

grpeacock avatar Aug 07 '19 15:08 grpeacock