Click here to Skip to main content
15,507,406 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to launch a local HTML file with UFT in google chrome. I am using the below code to launch

VBScript
SystemUtil.Run "chrome.exe","C:\Profiles_Export.html"


But the url entered is missing a colon. hence, due to incorrect url, the page is not launched.
It is launched as "c/Profiles_Export.html"
I have used the same code in another machine and it is working fine there. so, this doesnt seem like a code issue. Can anyone let me know what is going wrong here.


What I have tried:

I tried to launch with
VBScript
SystemUtil.Run "chrome.exe"
Browser("brwChrome").Navigate "C:\Profiles_Export.html"

But this also results in general error in first line.
Posted
Updated 15-Aug-22 4:25am
Comments
Richard MacCutchan 15-Aug-22 5:53am    
"But this also results in general error in first line."
What is the exact text of the error message? And also, where is this script code running?
Padmapriya Elangovan 15-Aug-22 6:23am    
Hi, exact error is just "General error occured". there is no other explanation mentioned in error popup. I am running this code in UFT
Richard MacCutchan 15-Aug-22 6:24am    
Sorry, but I do not know UFT, what is it?
Padmapriya Elangovan 15-Aug-22 6:24am    
No Problem, it is an automation testing tool which uses VbScript language.
Richard MacCutchan 15-Aug-22 6:26am    
OK, I just Googled and I think you should be asking your question at UFT One Help Center[^].

1 solution

The path to the file needs to be specified in URI format, even for local files. Your file should be specified like this:
SystemUtil.Run "chrome.exe","file:///C:\Profiles_Export.html"

* This is assuming SystemUtil doesn't do something weird to the arguments being passed to the command being launched.
 
Share this answer
 
Comments
Richard MacCutchan 15-Aug-22 10:40am    
I think you have an extra forward slash there, Dave.
Oops.
Dave Kreskowiak 15-Aug-22 11:58am    
:) "It's not flat. We checked."

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900