Ask a Question

My local folder is opened when running scripts on VM

tvklovesu
Frequent Contributor

My local folder is opened when running scripts on VM

Hello, so far I was able to do web application and now I have a testcase where I need to open a folder and click on a file to open it. When I run the script in local its working fine but when I run in headless mode in vm server till the step where opening the folder works fine but while opening the folder it opened again in my local system. 

I tried looking in to where to change the user type but still not able to run

here are some screenshots

tvklovesu_0-1675366272308.png

 

tvklovesu_1-1675366314545.png

 

 

9 REPLIES 9
Marsha_R
Community Hero

Put a log message in before the folder is opened to see what TC thinks the path name is. It may be something other than the user name.


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
tvklovesu
Frequent Contributor

How to check the path. in my tested application environment variables I have path and userprofile set to my local username. instead of using that how can I get the userprofile from the system that TC is running.

 

tvklovesu_0-1675369354522.png

 

 

tvklovesu_1-1675369419964.png

 

This article can help you with that

https://support.smartbear.com/testcomplete/docs/testing-with/tested-apps/desktop/variables-in-paths....


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
tvklovesu
Frequent Contributor

I looked at this but its again talking about the same Tested apps environmental variables as I shared before. In that path it already have my username hardcoded. Even at the run time it gets the same username. Instead I want to get the system's user name who logged in to that system. For that is there any other way like in script to get the userprofile name or path

Marsha_R
Community Hero

The screenshots you sent are from the Name Mapping, but the article is talking about settings in Tested Apps and the parameters in that screen. That is where you need to look at the path.


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
tvklovesu
Frequent Contributor

Sorry I thought I shared this image. This is the place where it says to provide the variables right? but even if I select %UserProfile% from the list it still takes my userprofile instead of the system where its running

 

tvklovesu_0-1675377670204.pngtvklovesu_1-1675377690055.png

 

Marsha_R
Community Hero

Here's how you can find the values of environment variables. Try this from the remote machine in a separate test and see what TC thinks the values are there.

 

https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqenvironment/getenvironme...


Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
tvklovesu
Frequent Contributor

Thanks @Marsha_R, I was able to get the Path of that remote machine. But it seems that the remote machine doesn't have userProfile in the environment variables. How can I add the userProfile variable at run time on remote machine?

 

Path from remote machine

C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\CCM\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Program Files (x86)\Java\jre1.8.0_351\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Adaptiva\AdaptivaClient\bin\x32;C:\Program Files (x86)\Adaptiva\AdaptivaClient\bin\x64

Marsha_R
Community Hero

There is a Set Path command that works to do that but I would check to make sure that's permitted on your vm server. IT may have some restrictions on that.

Marsha_R
[Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
cancel
Showing results for 
Search instead for 
Did you mean: