Interface ZestRuntime

    • Method Detail

      • getVariable

        String getVariable​(String name)
        Get the current value of the specified variable.
        Parameters:
        name - the name
        Returns:
        the current value of the specified variable
      • setVariable

        void setVariable​(String name,
                         String value)
        Set the value of the specified variable.
        Parameters:
        name -
        value -
      • getGlobalVariable

        default String getGlobalVariable​(String name)
        Gets a global variable.

        The global variables should outlive and be available to all scripts. How and where the variables are persisted and for how long is left as an implementation detail.

        Parameters:
        name - the name of the variable.
        Returns:
        the value of the variable, might be null if no value was previously set.
        Since:
        0.14.0
        See Also:
        setGlobalVariable(String, String)
      • setGlobalVariable

        default void setGlobalVariable​(String name,
                                       String value)
        Sets or removes a global variable.

        The variable is removed when the value is null.

        Parameters:
        name - the name of the variable.
        value - the value of the variable.
        Since:
        0.14.0
        See Also:
        getGlobalVariable(String)
      • getLastResponse

        ZestResponse getLastResponse()
        Get the last response.
        Returns:
        the last response
      • getLastRequest

        ZestRequest getLastRequest()
        Get the last request.
        Returns:
        the last request
      • replaceVariablesInString

        String replaceVariablesInString​(String str,
                                        boolean urlEncode)
        Replace any variables in the supplied string
        Parameters:
        str -
        urlEncode -
        Returns:
        the string with the variables replaces
      • setStandardVariables

        void setStandardVariables​(ZestRequest request)
        Sets the standard variables for a request.
        Parameters:
        request - the new standard variables
      • setStandardVariables

        void setStandardVariables​(ZestResponse response)
        Sets the standard variables for a response.
        Parameters:
        response - the new standard variables
      • setProxy

        void setProxy​(String host,
                      int port)
        Sets the proxy.
        Parameters:
        host - the host
        port - the port
      • getProxy

        String getProxy()
        Gets the proxy, as host:port
      • addWebDriver

        void addWebDriver​(String handle,
                          org.openqa.selenium.WebDriver wd)
        Add a handle associated with a WebDriver
        Parameters:
        handle -
        wd -
      • removeWebDriver

        void removeWebDriver​(String handle)
        Remove a handle associated with a WebDriver
        Parameters:
        handle -
      • getWebDriver

        org.openqa.selenium.WebDriver getWebDriver​(String handle)
        Get the WebDriver assicated with the handle
        Parameters:
        handle -
        Returns:
        the WebDriver.
      • getWebDrivers

        List<org.openqa.selenium.WebDriver> getWebDrivers()
        Return all of the WebDrivers
        Returns:
        all the WebDrivers.