Page 1 of 1

Setting the AutomationID within an MSI Installer

Posted: Thu Jan 24, 2013 6:34 pm
by JohnWashburn
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

Re: Setting the AutomationID within an MSI Installer

Posted: Thu Jan 24, 2013 8:45 pm
by JohnWashburn
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.

Re: Setting the AutomationID within an MSI Installer

Posted: Fri Jan 25, 2013 3:27 pm
by Support Team
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

Re: Setting the AutomationID within an MSI Installer

Posted: Mon Jan 28, 2013 10:40 pm
by JohnWashburn
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.

Re: Setting the AutomationID within an MSI Installer

Posted: Tue Jan 29, 2013 5:41 pm
by Support Team
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)

Re: Setting the AutomationID within an MSI Installer

Posted: Thu Jan 31, 2013 1:47 am
by JohnWashburn
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.

Re: Setting the AutomationID within an MSI Installer

Posted: Thu Jan 31, 2013 9:48 am
by Support Team
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

Re: Setting the AutomationID within an MSI Installer

Posted: Thu Jan 31, 2013 4:37 pm
by JohnWashburn
The email has been sent with a link to this thread within the email body.

Re: Setting the AutomationID within an MSI Installer

Posted: Thu Jan 31, 2013 8:18 pm
by JohnWashburn
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)"

Re: Setting the AutomationID within an MSI Installer

Posted: Fri Feb 01, 2013 2:42 pm
by Support Team
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

Re: Setting the AutomationID within an MSI Installer

Posted: Fri Feb 01, 2013 10:48 pm
by JohnWashburn
The email failed again, but the FTP upload worked. The snapshot should be on the FTP server now.

Re: Setting the AutomationID within an MSI Installer

Posted: Sat Feb 02, 2013 11:20 pm
by Support Team
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

Re: Setting the AutomationID within an MSI Installer

Posted: Mon Feb 04, 2013 3:32 pm
by Support Team
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

Re: Setting the AutomationID within an MSI Installer

Posted: Tue Apr 16, 2013 3:08 pm
by JohnWashburn
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.

Re: Setting the AutomationID within an MSI Installer

Posted: Thu Apr 18, 2013 4:44 pm
by Support Team
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