How can I open an installer in a particular location without added that in the TestedApp. The location changes every time I run the installer, so I want to manually read the path that was saved in a text file and assign it to a variable and then open the installer in that path using VB script.
You can have the installer added to TestedApp collection and then from code change it's path at a runtime.
It would look something like this:
TestedApp.MyAppName.Path = myPath;
Where "myPath" is a path read from this text file.
It's better to have an app accessible through TestedApp collection than trying to control it with Windows Scripting Host. One reason is that it can be recognized as Open Application. Then the installation process can be easily performed (of course if the installer has a some kind of wizard and it's not a command line).
Check out "TestedApp Object" help topic.
Actually, the AUT will be recognized as Open if you start it via WScript.Shell. The only limitation here is if you want to use the RunAs command - in this case, the only reliable way is to use TestedApps.
However, in general, you're right. Using TestedApps is a preferred approach.
@Lukasz: Your suggestion worked like a charm. Here is the VB script that worked for me and might be useful to other members who read this.
Dim SampleApp, FileName, Path
' Obtains the tested application
Set SampleApp = TestedApps.Items("SampleApp")
' Specifies the path to the executable
Path = "D:\Work Folder\Applications"
SampleApp.Path = Path
' Launches the tested application
I've seen in .NET and VCL Borland application(Maybe past tense is the issue here). Problem existed when I run application without testedapp collection and played a test. Sometimes it didn't recognize some windows and sometimes playback was extremely slow. So I had this habit that I didn't run my app from executable but from TC even I was doing some manual things.