Antoine_Sauteron_1266

Opening a url via the Automation Engine

Discussion created by Antoine_Sauteron_1266 on Feb 22, 2017
Latest reply on Jul 18, 2017 by joel_wiesmann_automic
We would like to run HTTP request from UC4. For example, if we enter a request in the browser, sms will be sent.
How can we run it trough UC4? Can we use dynamic params ?

It's possible to open a browser session from a Windows job with this command:
start <browser.exe> <url>
e.g.
start firefox.exe http://google.com

You may as well use a script variable as the url :

ex:
:SET &URL# = "http://google.com"
start firefox.exe &URL#

However it's not possible to use a script variable to define one or several parts of the url, because of the "&" character which is used in script variables' names. This character is also commonly used in urls, which makes the variable resolution fail at runtime.

e.g.
:SET &DOMAIN# = "http://google"
:SET &EXTENSION# = ".com"
start chrome.exe &DOMAIN#&EXT#

Will fail:
c:\>start chrome.exe http://google  & EXT#
'EXT#' is not recognized as an internal or external command,
operable program or batch file.

As a workaround you may store the complete url into a single script variable:
:SET &DOMAIN# = "http://google"
:SET &EXTENSION# = ".com"
:SET &URL#=&DOMAIN#&EXTENSION#
start firefox.exe &URL#

Best regards,
Antoine

Outcomes