Forum Discussion
15 Replies
Sort By
- Hi Yoni,
See the Path to Tested Applications section of the Avoiding Computer-Specific Settings help topic. - yoniNew ContributorHi Allen,
I've read this section before posting and it is not suitable for our needs (the application must run from a local HD).
Is there any other way of doing it?
Thanks,
Y - Hi Yoni,
As it is said in the help topic, you can use a relative path to your application. As an alternative, see the following SmartBear forums thread. - valentineContributorHi,
If am not mistaken, it is possible to invoke the path to 'program files' in your code.
I have done that in several of my code:
Try this line of code:
aqEnvironment.GetEnvironmentVariable("PROGRAMFILES") +" \\<The path to your stored appi here>"
... - ksoOccasional ContributorHi,
Here is a jscript function that must be called before the use of TestedApps variable.
As the TestedApps.tcTas file may be saved after execution, i change the path of the tested application
in the two direction so that i don't matter the os of the last execution :
I f i run the test on 64 bits os, i change to Program Files (x86)
else i change to Program Files
function ChangeAppPathNameOs()
{
var application,index;
var os64bits = Sys.OSInfo.Windows64bit;
if (os64bits) {
for ( index=0;index<TestedApps.Count;index++)
{
application = TestedApps.Items(index);
application.Path = application.Path.replace('Program Files\\','Program Files (x86)\\');
}
} else
{
for ( index=0;index<TestedApps.Count;index++)
{
application = TestedApps.Items(index);
application.Path = application.Path.replace('Program Files (x86)\\','Program Files\\');
}
}
} - QAPittOccasional ContributorYoni,
Have you found a way to do this yet? I've just run into the same issue and I could use a tip if you've got it.
Thanks,
Yehuda
Hi Yehuda,
Have you looked through all the suggestions mentioned in this thread? If you have any problems using them, let us know.- QAPittOccasional ContributorKarim,
how would you write that in VBScript?
Thanks - QAPittOccasional ContributorWould this work for VBScripting?
Sub ChangeASaMenuPath ()
Dim Application
Dim os64bits
Dim aSaMenuPath
os64bits = sys.OSInfo.Windows64bit
aSaMenuPath = testedapps.aSaMenu.Path
if (os64bits = true) then
Application = Replace(aSaMenuPath,"Program Files","Program Files (x86)")
else
Application = Replace(aSaMenuPath,"Program Files (x86)","Program Files")
End If
End Sub
It runs through without error but doesn't actually seem to do anything. - rminnichContributor
I used a slightly different solution. I created 2 TestedApp objects for each application that had a path that varied, one for x86 and one for x64 OS's.
Starting each app effectively became:
If sys.OSInfo.Windows64bit then
Call TestedApps.MyApp_x64.Run(-1, true)
else
Call TestedApps.MyApp_x86.Run(-1, true)
end ifIf the path specified by the environment variable ProgramFiles (or ProgramFiles(x86) on 64 bit OS's) changes across PCs, you may need to update each tested app further to always point to the correct path for 32-bit program files (i.e., it's e:\program files (x86) on some PCs while it's c:\program files (x86) on others).
Related Content
- 7 months agotarttdh
Recent Discussions
- 3 hours agoSubhraDas
- 22 hours agotramuntana