Skip to content

go_to_url

roei sabag edited this page Jul 12, 2020 · 1 revision

Description

Load a new web page in the current browser window. This is done using an HTTP GET operation and the method will block until the load is complete. This action supports locators, elements, attributes, macros and regular expressions.

Scope

Web, Mobile Web

Properties

Property Description
argument Plugin conditions and additional information.
onAttribute The element attribute from which to extract information for action execution. If not specified, information will be taken from the element inner text.
onElement The locator value by which the element will be found.
locator The locator type by which the element will be found.
regularExpression A pattern by which the extracted information will be evaluated. Returns the first match.

Command Line Arguments (CLI)

blank

Opens the URL address using _blank property (under new tab or window).

url

The URL address to navigate to.

If the action argument is the URL to navigate to, this argument is not mandatory (see examples).

W3C Web Driver Protocol

https://www.w3.org/TR/webdriver/#navigate-to

Examples

Example no. 1

Navigate to https://gravitymvctestapplication.azurewebsites.net/uicontrols/.

Action Rule (JSON)

{
    "action": "GoToUrl",
    "argument": "https://gravitymvctestapplication.azurewebsites.net/uicontrols/"
}

Rhino Literal

go to url {https://gravitymvctestapplication.azurewebsites.net/uicontrols/}

// aliases (alternatives)
open {https://gravitymvctestapplication.azurewebsites.net/uicontrols/}
navigate to {https://gravitymvctestapplication.azurewebsites.net/uicontrols/}
go to {https://gravitymvctestapplication.azurewebsites.net/uicontrols/}

CSharp

// option no.1
var actionRule = new ActionRule
{
    Action = PluginsList.GoToUrl,
    Argument = "https://gravitymvctestapplication.azurewebsites.net/uicontrols/"
};

// option no.2
var actionRule = new
{
    Action = "GoToUrl",
    Argument = "https://gravitymvctestapplication.azurewebsites.net/uicontrols/"
};

Python

action_rule = {
    "action": "GoToUrl",
    "argument": "https://gravitymvctestapplication.azurewebsites.net/uicontrols/"
}

Java Script

var actionRule = {
    action: "GoToUrl",
    argument: "https://gravitymvctestapplication.azurewebsites.net/uicontrols/"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("GoToUrl")
        .setArgument("https://gravitymvctestapplication.azurewebsites.net/uicontrols/");

Example no. 2

Navigate to https://gravitymvctestapplication.azurewebsites.net/uicontrols/ using _blank operation (new tab or window).

Action Rule (JSON)

{
    "action": "GoToUrl",
    "argument": "{{$ --url:https://gravitymvctestapplication.azurewebsites.net/uicontrols/ --blank}}"
}

Rhino Literal

go to url {{$ --url:https://gravitymvctestapplication.azurewebsites.net/uicontrols/ --blank}}

// aliases (alternatives)
open {{$ --url:https://gravitymvctestapplication.azurewebsites.net/uicontrols/ --blank}}
navigate to {{$ --url:https://gravitymvctestapplication.azurewebsites.net/uicontrols/ --blank}}
go to {{$ --url:https://gravitymvctestapplication.azurewebsites.net/uicontrols/ --blank}}

CSharp

// option no.1
var actionRule = new ActionRule
{
    Action = PluginsList.GoToUrl,
    Argument = "{{$ --url:https://gravitymvctestapplication.azurewebsites.net/uicontrols/ --blank}}"
};

// option no.2
var actionRule = new
{
    Action = "GoToUrl",
    Argument = "{{$ --url:https://gravitymvctestapplication.azurewebsites.net/uicontrols/ --blank}}"
};

Python

action_rule = {
    "action": "GoToUrl",
    "argument": "{{$ --url:https://gravitymvctestapplication.azurewebsites.net/uicontrols/ --blank}}"
}

Java Script

var actionRule = {
    action: "GoToUrl",
    argument: "{{$ --url:https://gravitymvctestapplication.azurewebsites.net/uicontrols/ --blank}}"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("GoToUrl")
        .setArgument("{{$ --url:https://gravitymvctestapplication.azurewebsites.net/uicontrols/ --blank}}");

Example no. 3

Gets the text content of the element found by the given locator and pass it as URL to the current browser.

Action Rule (JSON)

{
    "action": "GoToUrl",
    "onElement": "url_div",
    "locator": "id"
}

Rhino Literal

go to url on {url_div} using {id}

// aliases (alternatives)
open on {url_div} using {id}
navigate to on {url_div} using {id}
go to on {url_div} using {id}

CSharp

// option no.1
var actionRule = new ActionRule
{
    Action = PluginsList.GoToUrl,
    OnElement = "url_div",
    Locator = LocatorsList.Id
};

// option no.2
var actionRule = new
{
    Action = "GoToUrl",
    OnElement = "url_div",
    Locator = "Id"
};

Python

action_rule = {
    "action": "GoToUrl",
    "onElement": "url_div",
    "locator": "id"
}

Java Script

var actionRule = {
    action: "GoToUrl",
    onElement: "url_div",
    locator: "id"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("GoToUrl")
        .setOnElement("url_div")
        .setLocator("Id");

Example no. 4

Gets the text content of the element found by the given locator and pass it as URL to a new browser tab or window.

Action Rule (JSON)

{
    "action": "GoToUrl",
    "argument": "{{$ --blank}}",
    "onElement": "url_div",
    "locator": "id"
}

Rhino Literal

go to url {{$ --blank}} on {url_div} using {id}

// aliases (alternatives)
open {{$ --blank}} on {url_div} using {id}
navigate to {{$ --blank}} on {url_div} using {id}
go to {{$ --blank}} on {url_div} using {id}

CSharp

// option no.1
var actionRule = new ActionRule
{
    Action = PluginsList.GoToUrl,
    Argument = "{{$ --blank}}",
    OnElement: "url_div",
    Locator: LocatorsList.Id
};

// option no.2
var actionRule = new
{
    Action = "GoToUrl",
    Argument = "{{$ --blank}}",
    OnElement: "url_div",
    Locator: "Id"
};

Python

action_rule = {
    "action": "GoToUrl",
    "argument": "{{$ --blank}}",
    "onElement": "url_div",
    "locator": "id"
}

Java Script

var actionRule = {
    action: "GoToUrl",
    argument: "{{$ --blank}}",
    onElement: "url_div",
    locator: "id"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("GoToUrl")
        .setArgument("{{$ --blank}}")
        .setOnElement("url_div")
        .setLocator("Id");

Example no. 5

Gets the href attribute value of the element found by the given locator and pass it as URL to the current browser.

Action Rule (JSON)

{
    "action": "GoToUrl",
    "onElement": "url_div",
    "onAttribute": "href",
    "locator": "Id"
}

Rhino Literal

go to url on {url_div} using {id} from {href}

// aliases (alternatives)
open on {url_div} using {id} from {href}
navigate to on {url_div} using {id} from {href}
go to on {url_div} using {id} from {href}

CSharp

// option no.1
var actionRule = new ActionRule
{
    Action = PluginsList.GoToUrl,
    OnElement = "url_div",
    OnAttribute = "href",
    Locator = LocatorsList.Id
};

// option no.2
var actionRule = new
{
    Action = "GoToUrl",
    OnElement = "url_div",
    OnAttribute = "href",
    Locator = "Id"
};

Python

action_rule = {
    "action": "GoToUrl",
    "onElement": "url_div",
    "onAttribute": "href",
    "locator": "Id"
}

Java Script

var actionRule = {
    action: "GoToUrl",
    onElement: "url_div",
    onAttribute: "href",
    locator: "Id"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("GoToUrl")
        .setOnElement("url_div")
        .setOnAttribute("href")
        .setLocator("Id");

Example no. 6

Gets the first match from the element href attribute value, found by the given locator, filtered by the given pattern and pass it as URL to the current browser.

Action Rule (JSON)

{
    "action": "GoToUrl",
    "onElement": "url_div_text",
    "onAttribute": "href",
    "locator": "Id",
    "regularExpression": "http.*$"
}

Rhino Literal

go to url on {url_div_text} using {id} filter {http.*$}

// aliases (alternatives)
open on {url_div_text} using {id} filter {http.*$}
navigate to {url_div_text} using {id} filter {http.*$}
go to on {url_div_text} using {id} filter {http.*$}

CSharp

// option no.1
var actionRule = new ActionRule
{
    Action = PluginsList.GoToUrl,
    OnElement: "url_div_text",
    OnAttribute: "href",
    Locator: "LocatorsList.Id",
    RegularExpression: "http.*$"
};

// option no.2
var actionRule = new
{
    Action = "GoToUrl",
    OnElement: "url_div_text",
    OnAttribute: "href",
    Locator: "Id",
    RegularExpression: "http.*$"
};

Python

action_rule = {
    "action": "GoToUrl",
    "onElement": "url_div_text",
    "onAttribute": "href",
    "locator": "Id",
    "regularExpression": "http.*$"
}

Java Script

var actionRule = {
    action: "GoToUrl",
    onElement: "url_div_text",
    onAttribute: "href",
    locator: "Id",
    regularExpression: "http.*$"
};

Java

ActionRule actionRule = new ActionRule()
        .setAction("GoToUrl")
        .setOnElement("url_div_text")
        .setOnAttribute("href")
        .setLocator("Id")
        .setRegularExpression("http.*$");

Clone this wiki locally