Forum Discussion
Can you include the actual code you're executing?
Also, in that TC log, there's an "Additional Info" tab that gives a lot of information... and a "Picture" tab that, if you have the option turned on, will include a screenshot of exactly what is occurring at the time of error.
Installer Shield has 4 process running but expected objects exits on third process, Seems issue in Windows 10 to access that but not in other OS though same number of process running .
Attached screenshot.
Any suggestion?
- tristaanogre6 years agoEsteemed Contributor
I'm curious if install shield has the same number of processes in Windows 7.
In any case, when searching for the active window, you should probably limit your search to visible windows. It's possible that this is due these multi-layered processes. When TestComplete goes searching for a process simply by the process name with no index, it's generally a crap-shoot as to whether or not you'll get the correct one.
- tristaanogre6 years agoEsteemed Contributor
That's a very nice nuclear powered bagel toaster you have written there. ;)
Seriously, though... seems like an overcomplicated bit of code to simply find and click on buttons on a form. I'm sure that descriptive object based programming like this is what happens in tools like Selenium or UFT or other tools... but it's not really necessary for TestComplete.
What happens if you simply do a "record" of your actions? how are things identified using TestComplete's built in object mapping feature aka NameMapping? While I'm not saying throw out your code, doing the record/playback may at least shed some light on how TestComplete "sees" things in order to better adjust your code.
Additionally... is there a particular reason why you need to automate, via UI, the Install Shield wizard for your application? If you are simply needing to install the application, I believe InstallShield installs usually have a command-line functionality that will simplify your world greatly. - Marsha_R6 years agoChampion Level 3
marunachalam wrote:
I am not installing only one machine, around 20 VM we need to install Application whenver get new build. :(
Yes but that's what command line is for. You don't need to have TestComplete click all the buttons. You just need the build to get on there somehow.
- marunachalam6 years agoOccasional Contributor
Below snippet trying to get the Active window and thats how its working in Window7. (To get Installer Window)
function InstallerDialog()
{
this.form = null
this.Process = function()
{
return this.Form().Parent;
}
this.Form = function()
{
if(this.form == null)
{
this.form = this.GetWindow();
}
return this.form;
};
this.WaitForForm = function(timeout)
{
return this.GetWindow(timeout).Exists;
};
/**
* Launches the installer.
* Param installerPath - the path to the AC installer executable.
*/
this.Launch = function(installerPath)
{
//Sys.OleObject('WScript.Shell').Run(installerPath);
//this.processName = dotNET.System_IO.Path.GetFileNameWithoutExtension(installerPath);
// new method, using ac's setup bat file
TestedApps.setupAC.Run();
};
this.YesNoButton = function(timeout) { return this.Form().Window("#32770", "IDS_WELCOME_TITLE", 1).Window("Button", "Yes", 1)};
this.NextButton = function(timeout) { return this.Form().WaitChild('Window("Button", "&Next >", *)', timeout != undefined ? timeout : 10000); };}
/**
* Gets the installer window.
*/
this.GetWindow = function(timeout)
{
return Sys.FindEx(['Name', 'Visible'], ['Window("#32770", "Amazing Charts V*", *)', true],
2, true, timeout == undefined ? 1000 : timeout);
} - marunachalam6 years agoOccasional Contributor
I am not installing only one machine, around 20 VM we need to install Application whenver get new build. :(
- tristaanogre6 years agoEsteemed Contributor
Understood that you need to automate the installation process... However, I question the necessarity of using the UI to do so. You can instantiate a WScript.Shell to fire off a command line to do an installation if the Installer allows it. Likewise, if you have the straight MSI file, you can do it with that. Or, if you have access to the binaries, you could do a simple file copy to get the application installed... all possible to be done via script code in TestComplete across 20+ VMs without having to interact with the UI.
The point: If one method of performing a task is proving difficult, find another way that could be easier.
As it is, the code that you have written makes no distinction between processes found. Basically this.Form().Parent returns the object with handle to ONE of the processes. However, it is possible that may not be the process that, later on, is the one that has your buttons and such on it. Or, one of those other processes maybe overlaying what you're trying to interact with. You make no distinction in that function call to indicate to pick a particular process... the process handle may change so what worked one moment may not another. This code needs to be built out to be more robust to better detect the active window, buttons, etc.
And, as mentioned... that may be more complicated than it is worth, especially if you can achieve the same result (installing the latest build) simply by running a commandline to do so. I would go that route, honestly, rather than pursuing installing via the UI.
Related Content
Recent Discussions
- 17 hours agotramuntana
- 3 days agoSlickRick