Setting the AutomationID within an MSI Installer

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
JohnWashburn
Posts: 54
Joined: Wed Jan 09, 2013 7:02 pm

Setting the AutomationID within an MSI Installer

Post by JohnWashburn » Thu Jan 24, 2013 6:34 pm

This is less a question about Ranorex and more a question about assignment of controlID within an MSI-based installer.

Cognex uses Ranorex to smoke test the installer created as part of the continuous integration builds. Ranorex Spy (and other tools) all correctly identify the controlID (aka automation ID0 of a widget found within the intall wizard application.

The problem is the controlID is unstable and changes with nearly every build. we have determined the test of the controlID (a string representation of an integer) is dependant on the NUMBER of things the installer ia managing (e.g. registry entries and files). If the contents of things change but not the number of things managed, then the control ID assigned are the same between tow builds of the installer.

But if the number of things managed by the install change the ID assinged to the wiget changes. Here is an example from tow builds:

Cognex In-Sight Software 4.8.0.Build1280.exe
Ranorex Spy: /form[@title~'^Cognex\ In-Sight\ Software\ ']/text[@controlid='21514']
Inspect.exe: AutomationId: "21514"
Cognex In-Sight Software 4.8.0.Build1326.exe
Ranorex Spy: /form[@title~'^Cognex\ In-Sight\ Software\ ']/text[@controlid='21515']
Inspect.exe: AutomationId: "21515"

Has anyone automated an MSI-based installer? If so, then how did you define the controlID (aka AutomationID) to be a text string of your choosing?

This is related to but different from the article at: http://www.ranorex.com/forum/best-way-t ... -t962.html

JohnWashburn
Posts: 54
Joined: Wed Jan 09, 2013 7:02 pm

Re: Setting the AutomationID within an MSI Installer

Post by JohnWashburn » Thu Jan 24, 2013 8:45 pm

Equally helpful to me would be a URL to a MSI installer forum where I could could cross-post and where this question would be on topic for that forum.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Setting the AutomationID within an MSI Installer

Post by Support Team » Fri Jan 25, 2013 3:27 pm

Hi,

Is there no other attribute which could be used for the object identification, like a text or an id?
Could you post a Ranorex snapshot file of that element, this would allow us to analyze this in detail.
Following link will show you how to generate a snapshot file:
Creating Ranorex Snapshot Files.

Thanks,
Markus
.
Image

JohnWashburn
Posts: 54
Joined: Wed Jan 09, 2013 7:02 pm

Re: Setting the AutomationID within an MSI Installer

Post by JohnWashburn » Mon Jan 28, 2013 10:40 pm

First, I am not inclined to use the text as an identifying attribute. That would limit the automation test to English and we support 15 languages at present.

The RX path generated by Ranorex spy fir the attached License text box is:
/form[@title~'^Cognex\ In-Sight\ Software\ ']/text[@controlid='21867']

This RxPath is from build 6125. Tomorrow (after 1 - 3 integration builds) this "magic" 5 digit control ID assigned by InstallShield will be different depending on how many files and registry entries have been added or deleted from the installer project.

How do I specify to InstallShield (or within the MSI database) that the controlID should be (for example) "CognexInstallerTextOfLicenseTerms" instead of 21867? BTW the replacement with the RegEx \d+, will not help because every text box, every static label, etc. has a similar 5 digit number as the control ID.

As I said less a question regarding Ranorex as it is a question about MSI-based installers and how to automate the testing of such installers. It is the first time for me, but doubt I am the first person ever to want to automate the testing of an MSI based installer.
Attachments
ScreenShots.zip
Screen Shots of the Installer Licensing Terms page
(517.98 KiB) Downloaded 195 times

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Setting the AutomationID within an MSI Installer

Post by Support Team » Tue Jan 29, 2013 5:41 pm

Hello,

Thank you for your screenshots.
Could you please post or send us a Ranorex Snapshot in order to analyze this issue?
Note: A Ranorex Snapshot contains additional information compared to a screenshot.

Regards,
Markus (T)
.
Image

JohnWashburn
Posts: 54
Joined: Wed Jan 09, 2013 7:02 pm

Re: Setting the AutomationID within an MSI Installer

Post by JohnWashburn » Thu Jan 31, 2013 1:47 am

Sorry for the misunderstanding of Snapshot.

I can't upload the Ranorex snap shot. There is a 1 megabyte limit preventing me from uploading the 5.2 megabyte snapshot. No matter which control on which dialog I right click the resulting snap shot is 5.0+ megabytes in size.

The .rxsnp file is densly encoded as neither the ZIP (deflate) nor RAR algorithims can compress the snap shot. Upon deeper investigation I see the .rxsnp file is compressed with the ZIP deflate algorithm. That explains the incompressibility..

Any ideas of how to get the 5.2 megabyte snapshot to you? Cognex has a service agreement with Ranorex if that helps.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Setting the AutomationID within an MSI Installer

Post by Support Team » Thu Jan 31, 2013 9:48 am

Hi,

You could send the snapshot file to our support mail address: [email protected], but please don't forget to add the link to the forum post to the email.

Regards,
Markus
.
Image

JohnWashburn
Posts: 54
Joined: Wed Jan 09, 2013 7:02 pm

Re: Setting the AutomationID within an MSI Installer

Post by JohnWashburn » Thu Jan 31, 2013 4:37 pm

The email has been sent with a link to this thread within the email body.

JohnWashburn
Posts: 54
Joined: Wed Jan 09, 2013 7:02 pm

Re: Setting the AutomationID within an MSI Installer

Post by JohnWashburn » Thu Jan 31, 2013 8:18 pm

The ranorex server rejected the email (its attachment actually) with this message:


Microsoft Forefront Security for Exchange Server has detected a virus.
Virus name: "string_resource_299"
File name: "winmail.dat->CognexInstallerLicenseTermsDialog.rxsnp"
State: Removed
Subject Line: "Ranorex Snapshot for Forum Thread"
Sender: "Washburn, John"
Location: "Microsoft//BMUS (string_resource_245)"

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Setting the AutomationID within an MSI Installer

Post by Support Team » Fri Feb 01, 2013 2:42 pm

Hello,

Thank you for the information. That's strange.
I sent you an email with the access information for our ftp server in order to upload the file there.

Regards,
Bernhard
.
Image

JohnWashburn
Posts: 54
Joined: Wed Jan 09, 2013 7:02 pm

Re: Setting the AutomationID within an MSI Installer

Post by JohnWashburn » Fri Feb 01, 2013 10:48 pm

The email failed again, but the FTP upload worked. The snapshot should be on the FTP server now.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Setting the AutomationID within an MSI Installer

Post by Support Team » Sat Feb 02, 2013 11:20 pm

JohnWashburn wrote:The email failed again
It does not seem to be our server blocking the email, according to the server logs. Could it be your outgoing mail server?
JohnWashburn wrote:The snapshot should be on the FTP server now.
We got the snapshot, thank you. We will report back to you once we analyzed the snapshot.

Regards,
Alex
Ranorex Team
.
Image

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Setting the AutomationID within an MSI Installer

Post by Support Team » Mon Feb 04, 2013 3:32 pm

Hello,

Thank you for the snapshot file.
Unfortunately I don't know how the controlID can be changed in your application. As workaround you can try to use the instance of the text element. For example "/form[@title~'^Cognex\ In-Sight\ Software\ ']/text[8]"
Another way is to pick out some language independent words within your license agreement to recognize the element.
Regarding your controlID, maybe someone else here in the forum can help you to change the controlID.

Regards,
Bernhard
.
Image

JohnWashburn
Posts: 54
Joined: Wed Jan 09, 2013 7:02 pm

Re: Setting the AutomationID within an MSI Installer

Post by JohnWashburn » Tue Apr 16, 2013 3:08 pm

Unfortunately using English text for object identification does not help me much.

One of the purposes of automating a test is so that you can run the same test in a variety of situations.

When I want to run the automated test using the German, French, Greek, bulgarian, and Japanese versions of the installers looking for English text will fail. This is why automated test should (to the greatest extent possible) use properties such as controlID or controlName which are invariant with respect to language and independent of the glyphs the control/widget happens to display on the screen.

I am still researching how control ID is set (or how to set controlName) within the install shield utilities.

Thank you for your help on this. I have altered the test to look for the English text (and clearly marked it as English Only). The English only test is still very useful for verifying the daily, integration build because the daily build is in English and it is other builds which create the variants for the 11 other languages. Shoring up the daily integration build with an English only test is useful and productive automation.

I dislike that I am forced to be in the language specific ditch though when it comes to automating the test for installers (MSI scripts, setup.exe, etc.). I have enough experience after 15 years of automation testing to know this will bite me in the posterior at some point in the future.

User avatar
Support Team
Site Admin
Site Admin
Posts: 11710
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Setting the AutomationID within an MSI Installer

Post by Support Team » Thu Apr 18, 2013 4:44 pm

Hello,

I understand.
In general Ranorex needs some attributes in order to recognize the elements uniquely.
If the application under test doesn't have such attributes it is hard to define a clear RanoreXPath to the elements in order to identify them language independent.
I hope you will not have too many troubles in your automation in the future.

Regards,
Bernhard
.
Image