I came across this post. I'm just sharing my solution.
/**
* Get Variable from URL and complete URL<br>
* Example:<br>
* var obj = GetUrlValue("UTID");
* Log.Message(obj.UTID);
* @method GetUrlValue
*
Param VarSearch {string} nome da variavel do URL
* @return query_string {object} returns object with complete url and variable required data
*/
function GetUrlValue(VarSearch){
var page = Sys.Browser(iexplore).WaitPage("http://*", 10000);
Log.Message(page.URL);
var query_string = {};
var query = page.URL;
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars
.split("=");
// If first entry with this name
if (typeof query_string[pair[0]] === "undefined") {
query_string[pair[0]] = pair[1];
// If second entry with this name
} else if (typeof query_string[pair[0]] === "string") {
var arr = [ query_string[pair[0]], pair[1] ];
query_string[pair[0]] = arr;
// If third or later entry with this name
} else {
query_string[pair[0]].push(pair[1]);
}
}
return query_string;
}