Forum Discussion
Hi,
After the install we could run a process method (https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/sys/process-method-sys-object.html) It simply searches for it among all processes that currently exist in the system.
So I would add this as a validation after the install step
Best,
Matt
- simonaferrara3 years agoFrequent Contributor
Hi,
anyone have got other ideas?
I can check the processes related to the application (as mattb explain) but this check is currently not enough, I would like to find a way to check if the application appears within the "Program and Feature" list.
Thanks
Simona
- Raviavi3 years agoOccasional Contributor
Hi Simona,
This is also an option using powershell script, but check the feasibility from your end
****************** Test Complete Code***************************************
function CheckProgramInstalled()
{
var WSH = Sys["OleObject"]("WScript.Shell");
var objExec = WSH["Exec"]("powershell -file C:\\****\\PowerscriptName.ps1");
objExec ["StdIn"]["Close"]();
var strOutput = objExec ["StdOut"]["ReadAll"]();
Log["Message"](strOutput);
}****************** Test Complete Code***************************************
in the above code power script(PS1 file - C:\\****\\PowerscriptName.ps1) is being used, you could create that file with below code using node pad and save as .ps1 extension or using powershell ise or VS CODE
$software = "PROGRAM NAME THAT YOU ARE SEARCHING";
$installed = (Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Where { $_.DisplayName -eq $software }) -ne $nullIf(-Not $installed) {
Write-Host "'$software' is not installed";
} else {
Write-Host "'$software' is installed."
}It works if machine is 64 bit
Else you can check using below in 2nd line of powershell script - I have not tried this
HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstal in 2nd line of powershell script
Related Content
Recent Discussions
- 2 days agovladd1