WinAppDriver icon indicating copy to clipboard operation
WinAppDriver copied to clipboard

Unable to find the element by ID for MSI Application

Open raghunathchary opened this issue 7 years ago • 5 comments

Hi, I'm trying to automate the installer *.msi application. but I couldn't locate the element by ID, Name or AutomationId. Same is working as expected when I run against the *.exe installer. So, does this supports *.msi apps?

raghunathchary avatar Jul 24 '19 14:07 raghunathchary

I'm facing the same problem

@timotiusmargo said in another issue that

Windows Application Driver should be able to control (interact with) anything that is shown in the inspect.exe

Inspect.exe works fine with MSI installers but winappdriver seems to not work. I was able to run installer but could not find elements neither by name, nor tagName, nor automationId, nor className

tubignat avatar Aug 26 '19 11:08 tubignat

MSI are quite tricky, they could start new processes, a.k.a. Custom Actions.

A quick/dirty way to see what's available during your session is saving it to a text file, like this:

File.WriteAllText(@"c:\temp\page-source.txt", session.PageSource);

danielsavi avatar Sep 17 '19 18:09 danielsavi

Does this appear to have a workaround?

I can launch the setup file, or find it by handle. When i get the page source: print(self.__driver.page_source) and it looks like the following.

inspect application can see the parent window, the child buttons and so forth...

xml version="1.0" encoding="utf-16"?><Window AcceleratorKey="" AccessKey="" AutomationId="" ClassName="#32770" FrameworkId="Win32" HasKeyboardFocus="True" HelpText="" IsContentElement="True" IsControlElement="True" IsEnabled="True" IsKeyboardFocusable="True" IsOffscreen="False" IsPassword="False" IsRequiredForForm="False" ItemStatus="" ItemType="" LocalizedControlType="dialog" Name="SensorView - InstallShield Wizard" Orientation="None" ProcessId="4568" RuntimeId="42.787750" x="0" y="0" width="500" height="381" CanMaximize="False" CanMinimize="False" IsModal="False" WindowVisualState="Normal" WindowInteractionState="ReadyForUserInteraction" IsTopmost="False" CanRotate="False" CanResize="False" CanMove="True" IsAvailable="True"

ctrickler avatar Nov 01 '19 18:11 ctrickler

I have the same question. Any answers?

tanrhua avatar Jan 27 '20 21:01 tanrhua

I have worked with MSI automation using Appium at my company and we found this approach(even though it is a bit heavy gave us reliability):

  • Launch the MSI(either using Appium or just built-in c# code as i had problems getting Appium to launch a .MSI)
  • Create the session using the toplevelwindows name of the MSI
  • Try to click/view items- Built into this do a page validation- i.e. check an element you know should be there is visible)
  • If the element is not visible restablish the session using the toplevelwindow name and retry the click
  • rinse and repeat with each click

This will work but is a bit slow. We decided for MSI testing we could take the hit on performance if it gave us reliablility i.e. going through gui takes 2 mins rather than 30 seconds it wasn't a concern.

I'd also suggest paying special attention to you delays and timeouts as we had real teething trouble with these.

OneSlicePrime avatar Nov 04 '20 11:11 OneSlicePrime