Class WebBrowser


  • public class WebBrowser
    extends java.lang.Object
    The WebBrowser class is the starting point for sending web requests. It can be used to create Request objects to send to a web server (using the createRequest(HttpMethod, Url) method).

    The WebBrowser class manages HTTP caching and cookies. It also provides many options for controlling how the various HTTP requests are handled.

    Each Web Virtual User has a separate WebBrowser object associated with it, which can be accessed by calling WebBrowserScript.getWebBrowser().

    e.g.

    
     Request request1 = getWebBrowser().createRequest(HttpMethod.GET, new Url("http://www.testplant.com/"), 1); 
     Response response1 = request1.send(); 
     
    • Constructor Summary

      Constructors 
      Constructor Description
      WebBrowser​(long cPtr, boolean cMemoryOwn)
      For internal use only.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addDefaultKeepSubRequestContentType​(java.lang.String typeFragment)
      Adds a Content-Type fragment, so the content of sub-request responses that match the specified Content-Type fragment will be kept by default for any subsequent Request objects created by this WebBrowser.
      void addDefaultKeepSubRequestContentUrl​(java.lang.String urlFragment)
      Adds a URL, so the content of sub-request responses that match the specified URL fragment will be kept by default for any subsequent Request objects created by this WebBrowser.
      void addResponseToCache​(CachedResponse response)
      Adds an entry to this WebBrowser object's cache.
      void cacheContentTypeDirectory​(java.lang.String contentTypeDirectory)
      Adds a Content-Type media type for which cached content is stored.
      void cacheContentTypeDirectory​(java.lang.String contentTypeDirectory, boolean cache)
      Adds or removes a Content-Type media type for which cached content is stored.
      boolean cacheSecureData()
      Returns true if secure (HTTPS) data will be cached.
      void clearCache()
      Clears the HTTP cache.
      void clearCookies()
      Clears the cookie cache.
      void clearDefaultHeaders()
      Removes all of the default HTTP headers.
      void closeAllConnections()
      Closes all of the open TCP/IP connections to the web server.
      boolean containsDefaultHeader​(java.lang.String header)
      Returns true if the specified HTTP header is set by default on Request objects created by this WebBrowser.
      Request createRequest​(HttpMethod method, Url url)
      Creates a Request object that can be used to send an HTTP request to the web server.
      Request createRequest​(HttpMethod method, Url url, int reference)
      Creates a Request object that can be used to send an HTTP request to the web server, specifying a unique identifier that can be used to track the request.
      WebSocket createWebSocket​(Url url, int reference)
      Creates a WebSocket object that can be used to send/receive WebSocket messages to/from the web server.
      WebSocketMessage createWebSocketMessage​(byte[] data)
      Creates a WebSocketMessage object that can be sent to the server.
      WebSocketMessage createWebSocketMessage​(byte[] data, boolean isBinary)
      Creates a WebSocketMessage object that can be sent to the server.
      WebSocketMessage createWebSocketMessage​(java.lang.String data)
      Creates a WebSocketMessage object that can be sent to the server.
      void delete()  
      void excludeContentTypeFromCache​(java.lang.String contentType)
      Adds a Content-Type for which cached content is not stored.
      int getAccessType()
      Gets the dwAccessType parameter to be passed to InternetOpen() used by WinInet/WinHTTP.
      int getBufferSize()
      Gets the size of the buffer used when reading TCP data from a socket.
      java.util.List<java.lang.String> getCachedContentTypeDirectories()
      Gets a list of all Content-Type media types for which cached content is stored.
      java.util.List<java.lang.String> getCachedContentTypeExclusions()
      Gets a list of all Content-Types for which cached content is not stored.
      int getCacheInMemoryContentLimit()
      Gets the maximum size of resources that can be cached in memory.
      boolean getCertificateDisplay()
      Returns true if client certificate names will be written to the event log.
      java.lang.String getCertificateStoreName()
      Gets the name of the system certificate store in which to search for client certificates.
      java.lang.String getCertificateSubject()
      Gets the subject to search for when selecting a client certificate.
      java.lang.String getCertLocation()
      Gets the location folder or file path for a client certificate.
      int getConnectionsPerServer()
      Gets the maximum number of connections allowed per server for a WinHTTP handler.
      ConnectionType getConnectionType​(boolean secure)
      Gets the ConnectionType in use.
      int getConnectRetries()
      Gets the number of times to attempt to connect to a web server before reporting a failure.
      int getConnectTimeout()
      Gets the time in milliseconds to wait for a TCP connection to be opened, before reporting a failure.
      boolean getCookiesSupported()
      Returns true if cookies will be handled automatically.
      java.lang.String getCookieValue​(java.lang.String domain, java.lang.String path, java.lang.String cookieName)
      Gets the value of the specified cookie, at the specified domain and path.
      static long getCPtr​(WebBrowser obj)
      For internal use only.
      java.lang.String getDefaultCharactersAllowedInPostedForm()
      Get the characters that, by default, will NOT be percent-encoded when a Form is sent to the web server using a POST request.
      int getDefaultConnectionIdleTimeout()
      Gets the time in milliseconds after which a TCP connection is considered to be idle, and automatically closed.
      java.util.List<java.lang.String> getDefaultContentTypeFragments()
      Gets a list of all the Content-Type fragments for which the content of sub-request responses will be kept by default for any subsequent Request objects created by this WebBrowser.
      java.util.List<java.lang.String> getDefaultContentUrlFragments()
      Gets a list of all the URL fragments for which the content of sub-request responses will be kept by default for any subsequent Request objects created by this WebBrowser.
      boolean getDefaultFollowRedirects()
      Returns true if redirects will automatically be followed for Request objects created by this WebBrowser.
      java.util.List<java.lang.String> getDefaultHeaderKeys()
      Gets a list of names of all the default HTTP request headers that will be set for every subsequent Request object created by this WebBrowser.
      java.lang.String getDefaultHeaderValue​(java.lang.String header)
      Gets the value of the specified default HTTP header.
      boolean getDefaultIncludeQueryDataInLabels()
      Returns true if URLs with different query data should be considered different from each other by default.
      boolean getDefaultKeepAllSubRequestContent()
      Returns true if the content of responses to sub-requests will be kept, for any subsequent Request objects created by this WebBrowser.
      boolean getDefaultKeepContent()
      Returns true if the content of responses will be kept, for any subsequent Request objects created by this WebBrowser.
      boolean getDefaultRetrieveSubRequests()
      Returns true if sub-requests will be retrieved for any subsequent Request objects created by this WebBrowser.
      int getDefaultSubRequestThreadCount()
      Gets the number of threads that will be used to fetch sub-requests from the web server, for any subsequent Request objects created by this WebBrowser.
      boolean getDefaultTimeEveryHttpRequest()
      Returns true if sub-requests will be timed as well as top-level HTTP requests, for any subsequent Request objects created by this WebBrowser.
      java.lang.String getDefaultUserAgent()
      Gets the value that the "User-Agent" HTTP header defaults to in Request objects created by this WebBrowser.
      java.lang.String getDefaultVersion()
      Gets the HTTP version as a String, as set by default for any subsequent Request objects created by this WebBrowser.
      int getDnsRetries()
      Gets the number of times that eggPlant Performance will retry a DNS lookup in the event of failure.
      int getDnsTimeout()
      Gets the time in milliseconds before a DNS lookup will time-out.
      boolean getEnableOptionalClientCertificates()
      Returns true if client certificates can be optional, in case the server requests a client certificate but doesn't require one.
      HostFilteringMode getHostFilteringMode()
      IpEndPoint getLocalIpEndPoint()
      Gets the local IpEndPoint to use when making a connection to a web server.
      int getMaxNetworkErrors()
      Gets the maximum number of network errors to accept before the script is terminated.
      int getMinorVersion()
      Gets the minor HTTP version number.
      java.lang.String getPassword()
      Gets the password that will be used for HTTP authentication.
      java.lang.String getProxy()
      Gets the address of the proxy server used by this WebBrowser.
      java.lang.String getProxyBypass()
      Gets the lpszProxyBypass parameter to be passed to InternetOpen() used by WinInet/WinHTTP.
      int getProxyPort()
      Gets the port number used by the proxy server for this WebBrowser.
      java.lang.String getProxyServer()
      Gets the lpszProxyName parameter to be passed to InternetOpen() used by WinInet/WinHTTP.
      int getReadRetries()
      Gets the number of times to attempt to read data from the web server before reporting a failure.
      int getReceiveTimeout()
      Gets the time in milliseconds to wait for a web server to respond to a request before reporting a failure.
      int getSendTimeout()
      Gets the time in milliseconds before a sent TCP packet will time-out.
      int getSSLrenegotiateTime()
      Gets the time in milliseconds after which the SSL connection must be renegotiated.
      java.lang.String getUser()
      Gets the username that will be used for HTTP authentication.
      VirtualUser getVirtualUser()
      Gets the VirtualUser instance that this WebBrowser is associated with.
      void ignoreHost​(java.lang.String domain)
      Prevents requests from being sent to the specified domain.
      void ignoreHostRegexp​(java.lang.String regexp)
      Prevents requests from being sent to any domain that matches the specified regular expression.
      void includeContentTypeInCache​(java.lang.String contentType)
      Adds a Content-Type for which cached content is stored.
      void includeHost​(java.lang.String domain)
      Allows requests to be sent to the specified domain.
      void includeHostRegexp​(java.lang.String regexp)
      Allow requests to be sent to any host that matches the given regular expression.
      boolean isCachingEnabled()
      Returns true if HTTP caching is enabled.
      boolean isDynatraceIntegrationEnabled()
      Returns true if dynaTrace integration is enabled.
      boolean isHostIgnored​(java.lang.String domain)
      Returns true if the specified domain is currently being ignored.
      boolean isLoggingEnabled()
      Returns true if detailed HTTP logging has been enabled for this Virtual User.
      boolean isLoggingSuspended()
      Returns true if detailed HTTP logging has been suspended for this Virtual User.
      boolean isSetCertLocation()
      Returns true if a certificate location has been set.
      boolean isSetProxy()
      Returns true if a proxy server has been defined for this WebBrowser.
      void removeCookie​(java.lang.String cookieName)
      Removes all cookies with the given name from the cookie cache
      void removeDefaultHeader​(java.lang.String header)
      Removes the specified default HTTP header.
      void removeDefaultKeepSubRequestContentType​(java.lang.String typeFragment)
      Removes a Content-Type fragment, so the content of sub-request responses that match the specified Content-Type fragment will no longer be kept by default for any subsequent Request objects created by this WebBrowser.
      void removeDefaultKeepSubRequestContentUrl​(java.lang.String urlFragment)
      Removes a URL, so the content of sub-request responses that match the specified URL fragment will no longer be kept by default for any subsequent Request objects created by this WebBrowser.
      boolean responseWithNoExpiryInformationIsFresh()
      Gets a value that indicates whether a response from a web server that does not contains any expiry information (such as an "Expires" or "Cache-Control, max-age" header) is treated as expired or not.
      void resumeLogging()
      Resumes detailed HTTP logging for this Virtual User.
      void saveCookie​(java.lang.String host, java.lang.String data)
      Saves cookie data for the specified host.
      void setAccess​(int accessType, java.lang.String proxyServer, java.lang.String proxyBypass)
      Sets the dwAccessType, lpszProxyName and lpszProxyBypass parameters to be passed to InternetOpen() used by WinInet/WinHTTP.
      void setAuthentication​(java.lang.String domain, java.lang.String username, java.lang.String password)
      Sets the domain, username and password that will be used for HTTP authentication.
      void setBufferSize​(int bufferSize)
      Sets the size of the buffer used when reading TCP data from a socket.
      void setCacheInMemoryContentLimit​(int value)
      Sets the maximum size of resources that can be cached in memory.
      void setCacheSecureData​(boolean cacheSecureData)
      Sets whether secure (HTTPS) data should be cached (true by default).
      void setCachingEnabled​(boolean value)
      Sets whether HTTP caching should be enabled.
      void setCertificateDisplay​(boolean display)
      Sets whether client certificate names should be written to the event log.
      void setCertificateStoreName​(java.lang.String storeName)
      Sets the name of the system certificate store in which to search for client certificates.
      void setCertificateSubject​(java.lang.String subject)
      Sets the subject to search for when selecting a client certificate.
      void setCertLocation​(java.lang.String path)
      Sets the location folder or file path for a client certificate.
      void setConnectionsPerServer​(int connections)
      Sets the maximum number of connections allowed per server for a WinHTTP handler.
      void setConnectRetries​(int retries)
      Sets the number of times to attempt to connect to a web server before reporting a failure.
      void setConnectTimeout​(int timeout)
      Sets the time in milliseconds to wait for a TCP connection to be opened, before reporting a failure.
      void setCookiesSupported()
      Sets automatic cookie handling to be enabled.
      void setCookiesSupported​(boolean on)
      Sets whether cookies should be handled automatically.
      void setDefaultCharactersAllowedInPostedForm​(java.lang.String charactersAllowedInPostedForm)
      Set the characters that, by default, will NOT be percent-encoded when a Form is sent to the web server using a POST request.
      void setDefaultConnectionIdleTimeout​(int timeout)
      Sets the time in milliseconds after which a TCP connection is considered to be idle, and automatically closed.
      void setDefaultFollowRedirects()
      Sets the behaviour of this WebBrowser so redirects will automatically be followed for any subsequent Request objects created.
      void setDefaultFollowRedirects​(boolean followRedirects)
      Sets whether redirects will automatically be followed for any subsequent Request objects created by this WebBrowser.
      void setDefaultHeader​(java.lang.String header)
      Sets a default HTTP request header for every subsequent Request object created by this WebBrowser, using the contents of the specified String.
      void setDefaultHeader​(java.lang.String header, java.lang.String value)
      Sets a default HTTP request header for every subsequent Request object created by this WebBrowser, as a name/value pair.
      void setDefaultIncludeQueryDataInLabels​(boolean includeQueryDataInLabels)
      Sets whether URLs with different query data should be considered different from each other by default.
      void setDefaultKeepAllSubRequestContent​(boolean keep)
      Sets whether the content of responses to sub-requests should be kept, for any subsequent Request objects created by this WebBrowser.
      void setDefaultKeepContent​(boolean keep)
      Sets whether to keep the content of responses by default, for any subsequent Request objects created by this WebBrowser.
      void setDefaultRetrieveSubRequests​(boolean getDefaultEmbeddedUrls)
      Sets whether sub-requests will be retrieved for any subsequent Request objects created by this WebBrowser.
      void setDefaultSubRequestThreadCount​(int subRequestThreadCount)
      Sets the number of threads that will be used to fetch sub-requests from the web server, for any subsequent Request objects created by this WebBrowser.
      void setDefaultTimeEveryHttpRequest​(boolean timings)
      Sets whether sub-requests should be timed as well as top-level HTTP requests, for any subsequent Request objects created by this WebBrowser.
      void setDefaultUserAgent​(java.lang.String userAgent)
      Sets the value that the "User-Agent" HTTP header defaults to in Request objects created by this WebBrowser.
      void setDefaultVersion​(java.lang.String version)
      Sets the HTTP version for any subsequent Request objects created by this WebBrowser.
      void setDnsRetries​(int retries)
      Sets the number of times that eggPlant Performance will retry a DNS lookup in the event of failure.
      void setDnsTimeout​(int timeout)
      Sets the time in milliseconds before a DNS lookup will time-out.
      void setDynatraceIntegrationEnabled​(boolean value)
      Sets whether or not dynaTrace integration is enabled.
      void setEnableOptionalClientCertificates​(boolean enable)
      Sets whether client certificates can be optional, in case the server requests a client certificate but doesn't require one.
      void setHostFilteringMode​(HostFilteringMode mode)
      void setLocalIpEndPoint​(IpEndPoint localIpEndPoint)
      Sets the local IpEndPoint to use when making a connection to a web server.
      void setMaxNetworkErrors​(int n)
      Sets the maximum number of network errors to accept before the script is terminated.
      void setMinorVersion​(int version)
      Sets the minor HTTP version number.
      void setPassword​(java.lang.String password)
      Sets the password that will be used for HTTP authentication.
      void setProxy​(java.lang.String proxy, int port)
      Sets the proxy server address and port.
      void setProxyUserPassword​(java.lang.String username, java.lang.String password)
      Sets the username and password that will be used for proxy authentication.
      void setReadRetries​(int n)
      Sets the number of times to attempt to read data from the web server before reporting a failure.
      void setReceiveTimeout​(int timeout)
      Sets the time in milliseconds to wait for a web server to respond to a request before reporting a failure.
      void setResponseWithNoExpiryInformationIsFresh​(boolean value)
      Sets a value that indicates whether a response from a web server that does not contains any expiry information (such as an "Expires" or "Cache-Control, max-age" header) is treated as expired or not.
      void setSendTimeout​(int timeout)
      Sets the time in milliseconds before a sent TCP packet will time-out.
      void setSSLrenegotiateTime​(int time)
      Sets the time in milliseconds after which the SSL connection must be renegotiated.
      void setUser​(java.lang.String user)
      Sets the username that will be used for HTTP authentication.
      void setUserPassword​(java.lang.String username, java.lang.String password)
      Sets the username and password that will be used for HTTP authentication.
      void suspendLogging()
      Suspends detailed HTTP logging for this Virtual User.
      boolean unignoreHost​(java.lang.String domain)
      Stops preventing requests from being sent to the specified domain.
      void unignoreHostRegexp​(java.lang.String regexp)
      Stops preventing requests from being sent to the domains that match the specified regular expression.
      void unincludeHost​(java.lang.String domain)
      Stop sending requests to the specified domain.
      void unincludeHostRegexp​(java.lang.String regexp)
      Stop sending requests to hosts that match the given regular expression.
      void unsetProxy()
      Unsets the proxy server address and port.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WebBrowser

        public WebBrowser​(long cPtr,
                          boolean cMemoryOwn)
        For internal use only. Of no interest to the user.
        Parameters:
        cPtr - pointer to the CPP wrapped object
        cMemoryOwn - indicates if this object is responsible for memory management of the CPP object
    • Method Detail

      • getCPtr

        public static long getCPtr​(WebBrowser obj)
        For internal use only. Of no interest to the user.
        Parameters:
        obj - a reference to an object of this class
        Returns:
        a long containing the address of the CPP wrapped object
      • delete

        public void delete()
      • getVirtualUser

        public VirtualUser getVirtualUser()
        Gets the VirtualUser instance that this WebBrowser is associated with.
        Returns:
        the VirtualUser instance that this WebBrowser is associated with
      • createRequest

        public Request createRequest​(HttpMethod method,
                                     Url url,
                                     int reference)
                              throws com.facilita.exception.NotImplementedException,
                                     BadValueException
        Creates a Request object that can be used to send an HTTP request to the web server, specifying a unique identifier that can be used to track the request. Note that the HTTP request is not sent until the Request.send() or Request.sendTopLevel() method is called.

        e.g.

         
         // Send a GET request to http://www.testplant.com/
         Request request1 = getWebBrowser().createRequest(HttpMethod.GET, new Url("http://www.testplant.com/"), 1); 
         Response response1 = request1.send(); 
         
        Parameters:
        method - the HttpMethod to use when sending the Request to the web server
        url - the Url that this request should be sent to
        reference - a unique identifier that can be used to track this Request
        Returns:
        the new Request object
        Throws:
        BadValueException - One of the parameters is invalid
        com.facilita.exception.NotImplementedException - An internal error occurred
      • createRequest

        public Request createRequest​(HttpMethod method,
                                     Url url)
                              throws com.facilita.exception.NotImplementedException,
                                     BadValueException
        Creates a Request object that can be used to send an HTTP request to the web server. Note that the HTTP request is not sent until the Request.send() or Request.sendTopLevel() method is called.

        e.g.

         
         // Send a GET request to http://www.testplant.com/
         Request request1 = getWebBrowser().createRequest(HttpMethod.GET, new Url("http://www.testplant.com/")); 
         Response response1 = request1.send(); 
         
        Parameters:
        method - the HttpMethod to use when sending the Request to the web server
        url - the Url that this request should be sent to
        Returns:
        the new Request object
        Throws:
        BadValueException - One of the parameters is invalid
        com.facilita.exception.NotImplementedException - An internal error occurred
      • setDefaultHeader

        public void setDefaultHeader​(java.lang.String header,
                                     java.lang.String value)
        Sets a default HTTP request header for every subsequent Request object created by this WebBrowser, as a name/value pair.

        This method is useful if there is a particular HTTP header that is required in every HTTP request by a particular application.

        e.g.

        
         // Set the "Accept-Language: en-GB" HTTP header for EVERY subsequent request 
         getWebBrowser().setDefaultHeader("Accept-Language", "en-GB");
         
         // Create a request
         Request request = getWebBrowser().createRequest(HttpMethod.GET, new Url("http://www.testplant.com/"));
        
         // Override the "Accept-Language" header for this request ONLY
         request.setHeader("Accept-Language", "en-US"); 
        
         Response response = request.send(); 
         
         // Subsequent requests will still use the "Accept-Language: en-GB" HTTP header
         
        Parameters:
        header - the header to set
        value - the default value of the header
        See Also:
        Request.setHeader(String, String), removeDefaultHeader(String), getDefaultHeaderValue(String)
      • setDefaultHeader

        public void setDefaultHeader​(java.lang.String header)
        Sets a default HTTP request header for every subsequent Request object created by this WebBrowser, using the contents of the specified String.

        This method is useful if there is a particular HTTP header that is required in every HTTP request by a particular application.

        e.g.

        
         // Set the "Accept-Language: en-GB" HTTP header for EVERY subsequent request 
         getWebBrowser().setDefaultHeader("Accept-Language: en-GB");
         
         // Create a request
         Request request = getWebBrowser().createRequest(HttpMethod.GET, new Url("http://www.testplant.com/"));
        
         // Override the "Accept-Language" header for this request ONLY
         request.setHeader("Accept-Language: en-US"); 
        
         Response response = request.send(); 
         
         // Subsequent requests will still use the "Accept-Language: en-GB" HTTP header
         
        Parameters:
        header - the full header to set
        See Also:
        Request.setHeader(String), removeDefaultHeader(String), getDefaultHeaderValue(String)
      • removeDefaultHeader

        public void removeDefaultHeader​(java.lang.String header)
        Removes the specified default HTTP header. Request objects created by this WebBrowser will no longer have this header set by default.
        Parameters:
        header - the name of the header to remove
        See Also:
        setDefaultHeader(String, String)
      • containsDefaultHeader

        public boolean containsDefaultHeader​(java.lang.String header)
        Returns true if the specified HTTP header is set by default on Request objects created by this WebBrowser.
        Parameters:
        header - the header to check for
        Returns:
        true if the specified header has been set as a default HTTP header
      • getDefaultHeaderValue

        public java.lang.String getDefaultHeaderValue​(java.lang.String header)
        Gets the value of the specified default HTTP header. Request objects created by this WebBrowser will have the specified HTTP header set with the value returned by this method.
        Parameters:
        header - the header to look for
        Returns:
        the value of the default HTTP header with the specified name, or an empty String if this header is not set by default
        See Also:
        setDefaultHeader(String, String), removeDefaultHeader(String), clearDefaultHeaders()
      • getDefaultUserAgent

        public java.lang.String getDefaultUserAgent()
        Gets the value that the "User-Agent" HTTP header defaults to in Request objects created by this WebBrowser. Calling this method is equivalent to calling getDefaultHeaderValue("User-Agent").
        Returns:
        the value of the "User-Agent" default HTTP header
        See Also:
        setDefaultUserAgent(String), getDefaultHeaderValue(String)
      • setDefaultUserAgent

        public void setDefaultUserAgent​(java.lang.String userAgent)
        Sets the value that the "User-Agent" HTTP header defaults to in Request objects created by this WebBrowser. Calling this method is equivalent to calling setDefaultHeaderValue("User-Agent", userAgent).
        Parameters:
        userAgent - the new value of the "User-Agent" default HTTP header
        See Also:
        getDefaultUserAgent(), setDefaultHeader(String, String)
      • getDefaultHeaderKeys

        public java.util.List<java.lang.String> getDefaultHeaderKeys()
                                                              throws com.facilita.exception.InternalError
        Gets a list of names of all the default HTTP request headers that will be set for every subsequent Request object created by this WebBrowser.
        Returns:
        a list of names of all the default HTTP request headers
        Throws:
        com.facilita.exception.InternalError - An internal error occurred
        See Also:
        setDefaultHeader(String)
      • setDefaultFollowRedirects

        public void setDefaultFollowRedirects​(boolean followRedirects)
        Sets whether redirects will automatically be followed for any subsequent Request objects created by this WebBrowser.

        If the response to a request is an HTTP redirect code (e.g. 301, 302), and the Request object has been set to follow redirects, then the eggPlant Performance engine will automatically follow the redirect link.

        If you only want to change automatic redirecting for a single request, then it is better to call Request.setFollowRedirects(boolean) instead of this method.

        Parameters:
        followRedirects - true if redirects should be followed automatically
        See Also:
        Request.setFollowRedirects(boolean)
      • setDefaultFollowRedirects

        public void setDefaultFollowRedirects()
        Sets the behaviour of this WebBrowser so redirects will automatically be followed for any subsequent Request objects created.

        If the response to a request is an HTTP redirect code (e.g. 301, 302), and the Request object has been set to follow redirects, then the eggPlant Performance engine will automatically follow the redirect link.

        If you only want to change automatic redirecting for a single request, then it is better to call Request.setFollowRedirects(boolean) instead of this method.

        See Also:
        setDefaultFollowRedirects(boolean), Request.setFollowRedirects()
      • getDefaultFollowRedirects

        public boolean getDefaultFollowRedirects()
        Returns true if redirects will automatically be followed for Request objects created by this WebBrowser.

        If the response to a request is an HTTP redirect code (e.g. 301, 302), and the Request object has been set to follow redirects, then the eggPlant Performance engine will automatically follow the redirect link.

        Returns:
        true if redirects will automatically be followed for Request objects created
        See Also:
        setDefaultFollowRedirects(boolean), Request.getFollowRedirects()
      • setDefaultRetrieveSubRequests

        public void setDefaultRetrieveSubRequests​(boolean getDefaultEmbeddedUrls)
        Sets whether sub-requests will be retrieved for any subsequent Request objects created by this WebBrowser. See the Request.send() method for more information.
        Parameters:
        getDefaultEmbeddedUrls - true if sub-requests should be retrieved by default
        See Also:
        Request.send(), Request.setRetrieveSubRequests(boolean)
      • getDefaultRetrieveSubRequests

        public boolean getDefaultRetrieveSubRequests()
        Returns true if sub-requests will be retrieved for any subsequent Request objects created by this WebBrowser. See the Request.send() method for more information.
        Returns:
        true if sub-requests will be retrieved for Request objects by default
        See Also:
        Request.getRetrieveSubRequests(), Request.send()
      • getDefaultIncludeQueryDataInLabels

        public boolean getDefaultIncludeQueryDataInLabels()
        Returns true if URLs with different query data should be considered different from each other by default. If this returns true, then the query data will be included in the HTTP metric labels.

        e.g.

        • http://localhost:32144/search?q=camera
        • http://localhost:32144/search?q=laptop
        It may be important to compare how the query data affects the performance timing data, or you may wish to consider both requests as accessing the same URL under the same label http://localhost:32144/search.
        Returns:
        true if URL query data will be included in the HTTP metric labels by default
        See Also:
        setDefaultIncludeQueryDataInLabels(boolean), Request.getIncludeQueryDataInLabels()
      • setDefaultIncludeQueryDataInLabels

        public void setDefaultIncludeQueryDataInLabels​(boolean includeQueryDataInLabels)
        Sets whether URLs with different query data should be considered different from each other by default. If set to true, then the query data will be included in the HTTP metric labels.

        e.g.

        • http://localhost:32144/search?q=camera
        • http://localhost:32144/search?q=laptop
        It may be important to compare how the query data affects the performance timing data, or you may wish to consider both requests as accessing the same URL under the same label http://localhost:32144/search.
        Parameters:
        includeQueryDataInLabels - true if URL query data should be included in the HTTP metric labels by default
        See Also:
        getDefaultIncludeQueryDataInLabels(), Request.setIncludeQueryDataInLabels(boolean)
      • setDefaultTimeEveryHttpRequest

        public void setDefaultTimeEveryHttpRequest​(boolean timings)
        Sets whether sub-requests should be timed as well as top-level HTTP requests, for any subsequent Request objects created by this WebBrowser. Top-level requests will always be timed, even if this is set to false.
        Parameters:
        timings - true if sub-requests should be timed by default as well as top-level HTTP requests
        See Also:
        getDefaultTimeEveryHttpRequest(), Request.setTimeEveryHttpRequest(boolean)
      • getDefaultTimeEveryHttpRequest

        public boolean getDefaultTimeEveryHttpRequest()
        Returns true if sub-requests will be timed as well as top-level HTTP requests, for any subsequent Request objects created by this WebBrowser. Top-level requests will always be timed, even if this method returns false.
        Returns:
        true if sub-requests will be timed by default as well as top-level HTTP requests
        See Also:
        setDefaultTimeEveryHttpRequest(boolean), Request.getTimeEveryHttpRequest()
      • getDefaultSubRequestThreadCount

        public int getDefaultSubRequestThreadCount()
        Gets the number of threads that will be used to fetch sub-requests from the web server, for any subsequent Request objects created by this WebBrowser. If this value is increased, then more sub-requests can be fetched in parallel. However, using more threads will increase the load on the injector machine.
        Returns:
        the number of threads that will be used by default to fetch sub-requests from the web server
        See Also:
        setDefaultSubRequestThreadCount(int), Request.getSubRequestThreadCount()
      • setDefaultSubRequestThreadCount

        public void setDefaultSubRequestThreadCount​(int subRequestThreadCount)
        Sets the number of threads that will be used to fetch sub-requests from the web server, for any subsequent Request objects created by this WebBrowser. If this value is increased, then more sub-requests can be fetched in parallel. However, using more threads will increase the load on the injector machine.
        Parameters:
        subRequestThreadCount - the number of threads that will be used by default to fetch sub-requests from the web server
        See Also:
        getDefaultSubRequestThreadCount(), Request.setSubRequestThreadCount(int)
      • getDefaultVersion

        public java.lang.String getDefaultVersion()
        Gets the HTTP version as a String, as set by default for any subsequent Request objects created by this WebBrowser.

        The version of HTTP in common use is currently "HTTP/1.1", but "HTTP/2" can be used to enable HTTP/2 support where applicable.

        Returns:
        the HTTP version set by default
        See Also:
        setDefaultVersion(String), Request.getVersion()
      • setDefaultVersion

        public void setDefaultVersion​(java.lang.String version)
        Sets the HTTP version for any subsequent Request objects created by this WebBrowser.

        The version of HTTP in common use is currently "HTTP/1.1", but "HTTP/2" can be used to enable HTTP/2 support where applicable.

        Parameters:
        version - the HTTP version to use by default
        See Also:
        getDefaultVersion(), Request.setVersion(String)
      • setDefaultKeepAllSubRequestContent

        public void setDefaultKeepAllSubRequestContent​(boolean keep)
        Sets whether the content of responses to sub-requests should be kept, for any subsequent Request objects created by this WebBrowser.

        If this is set to false, then all the responses to sub-requests will be discarded. There is a significant performance penalty to keep the sub-request content, so this value should only be set to true if it is necessary to examine the content of sub-responses.

        Parameters:
        keep - true if the content of responses to sub-requests should be kept by default
        See Also:
        getDefaultKeepAllSubRequestContent(), setDefaultKeepContent(boolean), addDefaultKeepSubRequestContentType(String), addDefaultKeepSubRequestContentUrl(String)
      • setDefaultKeepContent

        public void setDefaultKeepContent​(boolean keep)
        Sets whether to keep the content of responses by default, for any subsequent Request objects created by this WebBrowser.

        If this value is set to false then the content of every response to this Request will be discarded, and it will not be possible to examine the content using the Response class (but other information will still be accessible in the Response objects).

        Parameters:
        keep - true if the content of responses should be kept by default
        See Also:
        getDefaultKeepContent(), setDefaultKeepAllSubRequestContent(boolean)
      • addDefaultKeepSubRequestContentType

        public void addDefaultKeepSubRequestContentType​(java.lang.String typeFragment)
        Adds a Content-Type fragment, so the content of sub-request responses that match the specified Content-Type fragment will be kept by default for any subsequent Request objects created by this WebBrowser.

        In general, it is not necessary to retain content for sub-requests, and it will incur a performance penalty to do so. However, a situation may arise where it is necessary to check or extract a value from a sub-response. In this situation, you can specify that the content of certain sub-responses should be retained.

        e.g.

        
         // Keep the content of any sub-requests that have a Content-Type starting with "text" (e.g. text/html, text/xml)
         getWebBrowser().addDefaultKeepSubRequestContentType("text");
         
        Parameters:
        typeFragment - sub-request responses that have a Content-Type header containing this typeFragment will be kept by default
        See Also:
        getDefaultKeepContent(), getDefaultKeepAllSubRequestContent(), removeDefaultKeepSubRequestContentType(String), addDefaultKeepSubRequestContentUrl(String)
      • addDefaultKeepSubRequestContentUrl

        public void addDefaultKeepSubRequestContentUrl​(java.lang.String urlFragment)
        Adds a URL, so the content of sub-request responses that match the specified URL fragment will be kept by default for any subsequent Request objects created by this WebBrowser.

        In general, it is not necessary to retain content for sub-requests, and it will incur a performance penalty to do so. However, a situation may arise where it is necessary to check or extract a value from a sub-response. In this situation, you can specify that the content of certain sub-responses should be retained.

        e.g.

        
         // Keep the content of the sub-request with the url http://localhost/images/magnifying-glass.png
         getWebBrowser().addDefaultKeepSubRequestContentUrl("http://localhost/images/magnifying-glass.png");
         
        Parameters:
        urlFragment - the responses from sub-requests that match this urlFragment will be kept by default
        See Also:
        getDefaultKeepContent(), getDefaultKeepAllSubRequestContent(), removeDefaultKeepSubRequestContentUrl(String), addDefaultKeepSubRequestContentType(String)
      • removeDefaultKeepSubRequestContentType

        public void removeDefaultKeepSubRequestContentType​(java.lang.String typeFragment)
        Removes a Content-Type fragment, so the content of sub-request responses that match the specified Content-Type fragment will no longer be kept by default for any subsequent Request objects created by this WebBrowser.

        In general, it is not necessary to retain content for sub-requests, and it will incur a performance penalty to do so. However, a situation may arise where it is necessary to check or extract a value from a sub-response. In this situation, you can specify that the content of certain sub-responses should be retained.

        e.g.

        
         // Don't keep the content of any sub-requests that have a Content-Type starting with "text" (e.g. text/html, text/xml)
         getWebBrowser().removeDefaultKeepSubRequestContentType("text");
         
        Parameters:
        typeFragment - sub-request responses that have a Content-Type header containing this typeFragment will no longer be kept by default
        See Also:
        addDefaultKeepSubRequestContentType(String), setDefaultKeepAllSubRequestContent(boolean)
      • removeDefaultKeepSubRequestContentUrl

        public void removeDefaultKeepSubRequestContentUrl​(java.lang.String urlFragment)
        Removes a URL, so the content of sub-request responses that match the specified URL fragment will no longer be kept by default for any subsequent Request objects created by this WebBrowser.

        In general, it is not necessary to retain content for sub-requests, and it will incur a performance penalty to do so. However, a situation may arise where it is necessary to check or extract a value from a sub-response. In this situation, you can specify that the content of a particular sub-responses should be retained.

        e.g.

        
         // Don't keep the content of the sub-request with the url http://localhost/images/magnifying-glass.png
         getWebBrowser().removeDefaultKeepSubRequestContentUrl("http://localhost/images/magnifying-glass.png");
         
        Parameters:
        urlFragment - the responses from sub-requests that match this urlFragment will no longer be kept by default
        See Also:
        getDefaultKeepContent(), getDefaultKeepAllSubRequestContent(), addDefaultKeepSubRequestContentUrl(String)
      • getDefaultContentUrlFragments

        public java.util.List<java.lang.String> getDefaultContentUrlFragments()
                                                                       throws com.facilita.exception.InternalError
        Gets a list of all the URL fragments for which the content of sub-request responses will be kept by default for any subsequent Request objects created by this WebBrowser.
        Returns:
        a list of all the URL fragments for which the content of sub-request responses will be kept by default
        Throws:
        com.facilita.exception.InternalError - An internal error occurred
        See Also:
        addDefaultKeepSubRequestContentUrl(String), removeDefaultKeepSubRequestContentUrl(String)
      • getDefaultContentTypeFragments

        public java.util.List<java.lang.String> getDefaultContentTypeFragments()
                                                                        throws com.facilita.exception.InternalError
        Gets a list of all the Content-Type fragments for which the content of sub-request responses will be kept by default for any subsequent Request objects created by this WebBrowser.
        Returns:
        a list of all the Content-Type fragments for which the content of sub-request responses will be kept by default
        Throws:
        com.facilita.exception.InternalError - An internal error occurred
        See Also:
        addDefaultKeepSubRequestContentType(String), removeDefaultKeepSubRequestContentType(String)
      • setCookiesSupported

        public void setCookiesSupported​(boolean on)
        Sets whether cookies should be handled automatically. If this is set to true, then eggPlant Performance will automatically store any cookies that are set by the web server, and send them back to the web server in subsequent requests.
        Parameters:
        on - true if cookies should be handled automatically
        See Also:
        getCookiesSupported()
      • setCookiesSupported

        public void setCookiesSupported()
        Sets automatic cookie handling to be enabled. If cookies are handled automatically, then eggPlant Performance will automatically store any cookies that are set by the web server, and send them back to the web server in subsequent requests.
        See Also:
        getCookiesSupported()
      • getCookiesSupported

        public boolean getCookiesSupported()
        Returns true if cookies will be handled automatically. If cookies are handled automatically, then eggPlant Performance will automatically store any cookies that are set by the web server, and send them back to the web server in subsequent requests.
        Returns:
        true if cookies will be handled automatically
        See Also:
        setCookiesSupported(boolean)
      • saveCookie

        public void saveCookie​(java.lang.String host,
                               java.lang.String data)
        Saves cookie data for the specified host. The host must be a hostname or TCP/IP address. Use this call to populate a browser with a set of pre-defined cookies or to add a cookie to the browser cookie cache.

        The cookie data is in the form of a "Set-Cookie" header as received from a server.

        e.g.

        
         getWebBrowser().saveCookie("www.mycookiesite.com", "SESSIONID=99; path=/cookies; expires=Mon, 01-Jan-2003 00:00:00 GMT");
         
        A path may be specified in the data, in which case the cookie value is only available at that path and any paths below it in the hierarchy.

        e.g.

        
         Set-Cookie: SESSIONID=99; path=/cookies; expires=Mon, 01-Jan-2003 00:00:00 GMT
        
         http://www.mycookiesite.com:8080/                   // No cookie available at this path
         http://www.mycookiesite.com:8080/cookies/           // Cookie SESSIONID=99 stored here
         http://www.mycookiesite.com:8080/cookies/howto      // SESSIONID=99 available here
         http://www.mycookiesite.com:8080/cookies/howto/bake // SESSIONID=99 available here
         
        If no path is specified, the path will default to "/". This causes the cookie to be sent on all requests to the domain.
        Parameters:
        host - the target domain
        data - the cookie name and value, in the form of a Set-Cookie header
        See Also:
        getCookieValue(String, String, String), setCookiesSupported(boolean)
      • getCookieValue

        public java.lang.String getCookieValue​(java.lang.String domain,
                                               java.lang.String path,
                                               java.lang.String cookieName)
        Gets the value of the specified cookie, at the specified domain and path. A cookie stored at a particular path is available to all paths below it in the hierarchy.

        e.g.

        
         Set-Cookie: SESSIONID=99; path=/cookies; expires=Mon, 01-Jan-2003 00:00:00 GMT
        
         http://www.mycookiesite.com:8080/                   // No cookie stored at this path
         http://www.mycookiesite.com:8080/cookies/           // Cookie SESSIONID stored here
         http://www.mycookiesite.com:8080/cookies/howto      // SESSIONID available here
         http://www.mycookiesite.com:8080/cookies/howto/bake // SESSIONID available here
         
         // assuming the cookie has been set as above,
         //the following calls can be made to obtain the value of SESSIONID
         String cookie;
         cookie = getWebBrowser().getCookieValue("www.mycookiesite.com", "/cookies/", "SESSIONID");
         cookie = getWebBrowser().getCookieValue("www.mycookiesite.com", "/cookies/howto/", "SESSIONID");
         cookie = getWebBrowser().getCookieValue("www.mycookiesite.com", "/cookies/howto/bake/", "SESSIONID");
        
         // the following call will not return a value as the path "/"
         // is above the path at which the cookie is stored ("/cookies")
         cookie = getWebBrowser().getCookieValue("www.mycookiesite.com", "/", "SESSIONID");
         
        Parameters:
        domain - the domain of the cookie
        path - the path within the domain of the cookie
        cookieName - the name of the cookie
        Returns:
        the value of the key/value pair stored as a cookie at the specified domain and path
        See Also:
        saveCookie(String, String), clearCookies()
      • clearCookies

        public void clearCookies()
        Clears the cookie cache. A WebBrowser object maintains its own cookie cache, and each Virtual User has its own instance of WebBrowser.

        This method clears the cookie cache in a similar manner to the Delete Cookies option within Internet Explorer.

        See Also:
        saveCookie(String, String), getCookieValue(String, String, String)
      • removeCookie

        public void removeCookie​(java.lang.String cookieName)
        Removes all cookies with the given name from the cookie cache
        Parameters:
        cookieName - the name of the cookie to remove
      • getUser

        public java.lang.String getUser()
        Gets the username that will be used for HTTP authentication.

        If the web server returns an HTTP 401 (Unauthorized) or 407 (Proxy Authentication Required) response to a request, then eggPlant Performance will automatically retry the request with an additional "Authorization" HTTP header, using this username.

        Returns:
        the username that will be used for HTTP authentication
        See Also:
        setUser(String), setUserPassword(String, String)
      • setUser

        public void setUser​(java.lang.String user)
        Sets the username that will be used for HTTP authentication.

        If the web server returns an HTTP 401 (Unauthorized) or 407 (Proxy Authentication Required) response to a request, then eggPlant Performance will automatically retry the request with an additional "Authorization" HTTP header, using this username.

        Parameters:
        user - the username that will be used for HTTP authentication
        See Also:
        getUser(), setUserPassword(String, String)
      • getPassword

        public java.lang.String getPassword()
        Gets the password that will be used for HTTP authentication.

        If the web server returns an HTTP 401 (Unauthorized) or 407 (Proxy Authentication Required) response to a request, then eggPlant Performance will automatically retry the request with an additional "Authorization" HTTP header, using this password.

        Returns:
        the password that will be used for HTTP authentication
        See Also:
        setPassword(String), setUserPassword(String, String)
      • setPassword

        public void setPassword​(java.lang.String password)
        Sets the password that will be used for HTTP authentication.

        If the web server returns an HTTP 401 (Unauthorized) or 407 (Proxy Authentication Required) response to a request, then eggPlant Performance will automatically retry the request with an additional "Authorization" HTTP header, using this password.

        Parameters:
        password - the password that will be used for HTTP authentication
        See Also:
        getPassword(), setUserPassword(String, String)
      • setUserPassword

        public void setUserPassword​(java.lang.String username,
                                    java.lang.String password)
        Sets the username and password that will be used for HTTP authentication.

        If the web server returns an HTTP 401 (Unauthorized) response to a request, then eggPlant Performance will automatically retry the request with an additional "Authorization" HTTP header, using this username and password.

        Parameters:
        username - the username that will be used for HTTP authentication
        password - the password that will be used for HTTP authentication
        See Also:
        getUser(), getPassword(), setUser(String), setPassword(String)
      • setAuthentication

        public void setAuthentication​(java.lang.String domain,
                                      java.lang.String username,
                                      java.lang.String password)
        Sets the domain, username and password that will be used for HTTP authentication.

        If the web server returns an HTTP 401 (Unauthorized) response to a request, then eggPlant Performance will automatically retry the request with an additional "Authorization" HTTP header, using this username and password.

        Parameters:
        domain - the domain that will be used for HTTP authentication
        username - the username that will be used for HTTP authentication
        password - the password that will be used for HTTP authentication
        See Also:
        getUser(), getPassword(), setUser(String), setPassword(String)
      • setProxyUserPassword

        public void setProxyUserPassword​(java.lang.String username,
                                         java.lang.String password)
        Sets the username and password that will be used for proxy authentication.

        If the web server returns an HTTP 407 (Proxy Authentication Required) response to a request, then eggPlant Performance will automatically retry the request with an additional "Proxy-Authorization" HTTP header, using this username and password.

        Parameters:
        username - the username that will be used for HTTP authentication
        password - the password that will be used for HTTP authentication
        See Also:
        getUser(), getPassword(), setUser(String), setPassword(String)
      • ignoreHost

        public void ignoreHost​(java.lang.String domain)
        Prevents requests from being sent to the specified domain.

        This method only has any effect if the HostFilteringMode is set to HostFilteringMode.BLOCKLIST.

        No HTTP/HTTPS requests will be made to this host. Use this method to prevent all HTTP calls to servers such as advertisement servers or servers that are offline.

        Warning: The test may not function correctly if server calls are not made that are necessary for the correct operation of the test.

        Parameters:
        domain - the host name to be ignored
        See Also:
        setHostFilteringMode(HostFilteringMode), unignoreHost(String), isHostIgnored(String)
      • unignoreHost

        public boolean unignoreHost​(java.lang.String domain)
        Stops preventing requests from being sent to the specified domain.

        This method only has any effect if the HostFilteringMode is set to HostFilteringMode.BLOCKLIST.

        Parameters:
        domain - the host name to be removed from the list of ignored hosts
        Returns:
        true if the host name was removed from the list of ignored hosts, or false if the host name did not exist in the list of ignored hosts
        See Also:
        ignoreHost(String), isHostIgnored(String)
      • isHostIgnored

        public boolean isHostIgnored​(java.lang.String domain)
        Returns true if the specified domain is currently being ignored.
        Parameters:
        domain - the host to check
        Returns:
        true if the specified domain is currently being ignored
        See Also:
        ignoreHost(String), unignoreHost(String)
      • ignoreHostRegexp

        public void ignoreHostRegexp​(java.lang.String regexp)
        Prevents requests from being sent to any domain that matches the specified regular expression.

        This method only has any effect if the HostFilteringMode is set to HostFilteringMode.BLOCKLIST.

        No HTTP/HTTPS requests will be made to any of these domains. Use this method to prevent all HTTP calls to servers such as advertisement servers or servers that are offline.

        Warning: The test may not function correctly if server calls are not made that are necessary for the correct operation of the test.

        Parameters:
        regexp - the regular expression to use
        See Also:
        ignoreHost(String), unignoreHost(String), isHostIgnored(String), unignoreHostRegexp(String)
      • clearCache

        public void clearCache()
        Clears the HTTP cache. A WebBrowser object maintains its own HTTP cache, and each Virtual User has its own instance of WebBrowser.

        This method clears the HTTP cache in a similar manner to the Delete Files option within Internet Explorer.

        See Also:
        isCachingEnabled(), setCachingEnabled(boolean)
      • isCachingEnabled

        public boolean isCachingEnabled()
        Returns true if HTTP caching is enabled.

        If HTTP caching is disabled, then every HTTP request will always be requested from the web server, even if the requested resource has already been downloaded.

        Returns:
        true if HTTP caching is enabled
      • setCachingEnabled

        public void setCachingEnabled​(boolean value)
        Sets whether HTTP caching should be enabled.

        If HTTP caching is disabled, then every HTTP request will always be requested from the web server, even if the requested resource has already been downloaded.

        Parameters:
        value - true if HTTP caching should be enabled
      • getCachedContentTypeDirectories

        public java.util.List<java.lang.String> getCachedContentTypeDirectories()
                                                                         throws com.facilita.exception.InternalError
        Gets a list of all Content-Type media types for which cached content is stored.

        There is a performance overhead incurred by storing resources in the cache. By default, eggPlant Performance will only store the content of resources with certain Content-Type media types:

        • application
        • message
        • model
        • multipart
        • text
        So, for example, all content with Content-Type "text/html", or "application/pdf" will be stored, but content with Content-Type "image/png" will be discarded. In most cases, there is no reason to access the contents of image data.

        Note that images are still cached, in that they will not be requested again from the web server once they have been downloaded; it is just the image data that is discarded.

        Returns:
        a list of all Content-Type media types for which cached content is stored
        Throws:
        com.facilita.exception.InternalError - An internal error occurred
        See Also:
        cacheContentTypeDirectory(String), cacheContentTypeDirectory(String, boolean)
      • cacheContentTypeDirectory

        public void cacheContentTypeDirectory​(java.lang.String contentTypeDirectory,
                                              boolean cache)
        Adds or removes a Content-Type media type for which cached content is stored.

        There is a performance overhead incurred by storing resources in the cache. By default, eggPlant Performance will only store the content of resources with certain Content-Type media types:

        • application
        • message
        • model
        • multipart
        • text
        So, for example, all content with Content-Type "text/html", or "application/pdf" will be stored, but content with Content-Type "image/png" will be discarded. In most cases, there is no reason to access the contents of image data.

        Note that images are still cached, in that they will not be requested again from the web server once they have been downloaded; it is just the image data that is discarded.

        Parameters:
        contentTypeDirectory - the Content-Type media type to add or remove e.g. "text", "application"
        cache - true if content with the specified media type should be stored
        See Also:
        clearCache(), setCachingEnabled(boolean), includeContentTypeInCache(String), excludeContentTypeFromCache(String)
      • cacheContentTypeDirectory

        public void cacheContentTypeDirectory​(java.lang.String contentTypeDirectory)
        Adds a Content-Type media type for which cached content is stored.

        There is a performance overhead incurred by storing resources in the cache. By default, eggPlant Performance will only store the content of resources with certain Content-Type media types:

        • application
        • message
        • model
        • multipart
        • text
        So, for example, all content with Content-Type "text/html", or "application/pdf" will be stored, but content with Content-Type "image/png" will be discarded. In most cases, there is no reason to access the contents of image data.

        Note that images are still cached, in that they will not be requested again from the web server once they have been downloaded; it is just the image data that is discarded.

        Parameters:
        contentTypeDirectory - the Content-Type media type to store e.g. "text", "application"
        See Also:
        clearCache(), setCachingEnabled(boolean), includeContentTypeInCache(String), excludeContentTypeFromCache(String)
      • getCachedContentTypeExclusions

        public java.util.List<java.lang.String> getCachedContentTypeExclusions()
                                                                        throws com.facilita.exception.InternalError
        Gets a list of all Content-Types for which cached content is not stored.

        There is a performance overhead incurred by storing resources in the cache. By default, eggPlant Performance will only store the content of resources with certain Content-Type media types:

        • application
        • message
        • model
        • multipart
        • text
        So, for example, all content with Content-Type "text/html", or "application/pdf" will be stored, but content with Content-Type "image/png" will be discarded. In most cases, there is no reason to access the contents of image data.

        Note that resources are still cached, in that they will not be requested again from the web server once they have been downloaded; it is just the data that is discarded.

        Returns:
        a list of all Content-Types for which cached content is not stored
        Throws:
        com.facilita.exception.InternalError - An internal error occurred
        See Also:
        excludeContentTypeFromCache(String), includeContentTypeInCache(String)
      • excludeContentTypeFromCache

        public void excludeContentTypeFromCache​(java.lang.String contentType)
        Adds a Content-Type for which cached content is not stored. There is a performance overhead incurred by storing resources in the cache.

        e.g.

        
         // do not store the content of "application/pdf" Content-Types
         getWebBrowser().excludeContentTypeFromCache("application/pdf");
         
        Note that resources are still cached, in that they will not be requested again from the web server once they have been downloaded; it is just the data that is discarded.
        Parameters:
        contentType - the Content-Type to exclude e.g. "text/xml", "application/pdf"
        See Also:
        includeContentTypeInCache(String), cacheContentTypeDirectory(String, boolean), clearCache(), setCachingEnabled(boolean)
      • includeContentTypeInCache

        public void includeContentTypeInCache​(java.lang.String contentType)
        Adds a Content-Type for which cached content is stored.

        There is a performance overhead incurred by storing resources in the cache. By default, eggPlant Performance will only store the content of resources with certain Content-Type media types:

        • application
        • message
        • model
        • multipart
        • text
        So, for example, all content with Content-Type "text/html", or "application/pdf" will be stored, but content with Content-Type "image/png" will be discarded. In most cases, there is no reason to access the contents of image data, but this method can be used to store specific types.

        e.g.

        
         // store the content of "image/png" Content-Types
         getWebBrowser().excludeContentTypeFromCache("image/png");
         
        Parameters:
        contentType - the Content-Type to include e.g. "text/xml", "application/pdf"
        See Also:
        cacheContentTypeDirectory(String, boolean), clearCache(), setCachingEnabled(boolean)
      • getCacheInMemoryContentLimit

        public int getCacheInMemoryContentLimit()
        Gets the maximum size of resources that can be cached in memory. Any cached resource that is larger than this will be written to disk. The default value is 2048 bytes. This limit can prevent the memory footprint of a Virtual User from becoming too large.
        Returns:
        the maximum size in bytes
        See Also:
        setCacheInMemoryContentLimit(int)
      • setCacheInMemoryContentLimit

        public void setCacheInMemoryContentLimit​(int value)
        Sets the maximum size of resources that can be cached in memory. Any cached resource that is larger than this will be written to disk. The default value is 2048 bytes. This limit can prevent the memory footprint of a Virtual User from becoming too large.
        Parameters:
        value - the maximum size in bytes
        See Also:
        getCacheInMemoryContentLimit()
      • setCacheSecureData

        public void setCacheSecureData​(boolean cacheSecureData)
        Sets whether secure (HTTPS) data should be cached (true by default).
        Parameters:
        cacheSecureData - true if secure data should be cached
        See Also:
        cacheSecureData(), setCachingEnabled(boolean)
      • addResponseToCache

        public void addResponseToCache​(CachedResponse response)
        Adds an entry to this WebBrowser object's cache. This method can be used to pre-populate a WebBrowser object's cache, prior to sending any requests to the web server.

        e.g.

        
         CachedResponse cachedResponse = new CachedResponse("http://myDomain/weather/images/symbols/57x57/3.gif");
         cachedResponse.setHeader("Expires", "Fri, 22 Aug 2008 16:23:24 GMT");
         cachedResponse.setHeader("Last-Modified", "Tue, 18 Mar 2008 11:37:40 GMT");
         cachedResponse.setHeader("ETag", "\"b23-905a6900\"");
        
         getWebBrowser().addResponseToCache(cachedResponse);
         
        Parameters:
        response - a CachedResponse representing a URL and appropriate HTTP request headers
      • setMaxNetworkErrors

        public void setMaxNetworkErrors​(int n)
        Sets the maximum number of network errors to accept before the script is terminated.
        Parameters:
        n - the maximum number of network errors
        See Also:
        getMaxNetworkErrors()
      • getMaxNetworkErrors

        public int getMaxNetworkErrors()
        Gets the maximum number of network errors to accept before the script is terminated.
        Returns:
        the maximum number of network errors
        See Also:
        setMaxNetworkErrors(int)
      • getProxy

        public java.lang.String getProxy()
        Gets the address of the proxy server used by this WebBrowser.
        Returns:
        the address of the proxy server used by this WebBrowser
        See Also:
        setProxy(String, int), getProxyPort()
      • getProxyPort

        public int getProxyPort()
        Gets the port number used by the proxy server for this WebBrowser.
        Returns:
        the port number used by the proxy server for this WebBrowser
        See Also:
        setProxy(String, int), getProxy()
      • setProxy

        public void setProxy​(java.lang.String proxy,
                             int port)
        Sets the proxy server address and port.

        Browsers often access target web servers via a proxy server.

        Parameters:
        proxy - the IP address or domain of the proxy server
        port - the port number of the proxy server
        See Also:
        getProxy(), getProxyPort()
      • unsetProxy

        public void unsetProxy()
        Unsets the proxy server address and port.

        Once this method has been called, any subsequent requests will go directly to the target domain, rather than via a proxy server.

        See Also:
        setProxy(String, int)
      • isSetProxy

        public boolean isSetProxy()
        Returns true if a proxy server has been defined for this WebBrowser. This method indicates that a domain name and port for a proxy server have been set, not whether the proxy server is configured correctly or whether a proxy server exists at the specified domain name and port.
        Returns:
        true if a proxy server has been defined for this WebBrowser
        See Also:
        setProxy(String, int)
      • getMinorVersion

        public int getMinorVersion()
        Gets the minor HTTP version number.

        The minor version number follows the dot, so for example HTTP 1.0 has a minor version number of 0.

        Note that this method only applies to WinInet and WinHTTP connections.

        Returns:
        the minor HTTP version number
        See Also:
        setMinorVersion(int)
      • setMinorVersion

        public void setMinorVersion​(int version)
        Sets the minor HTTP version number.

        The minor version number follows the dot, so for example HTTP 1.0 has a minor version number of 0.

        Note that this method only applies to WinInet and WinHTTP connections.

        Parameters:
        version - the minor HTTP version number
        See Also:
        getMinorVersion()
      • isLoggingEnabled

        public boolean isLoggingEnabled()
        Returns true if detailed HTTP logging has been enabled for this Virtual User.
        Returns:
        true if detailed HTTP logging has been enabled for this Virtual User
      • getConnectionType

        public ConnectionType getConnectionType​(boolean secure)
        Gets the ConnectionType in use.

        Note that it is possible to use different connection types for HTTP and HTTPS traffic; the secure parameter is used to distinguish between them.

        Parameters:
        secure - true to return the ConnectionType used for secure (HTTPS) connections, or false for unsecure (HTTP) connections
        Returns:
        the ConnectionType in use
      • getBufferSize

        public int getBufferSize()
        Gets the size of the buffer used when reading TCP data from a socket.
        Returns:
        the size of the buffer in bytes
        See Also:
        setBufferSize(int)
      • getDnsTimeout

        public int getDnsTimeout()
        Gets the time in milliseconds before a DNS lookup will time-out.
        Returns:
        the time in milliseconds before a DNS lookup will time-out
        See Also:
        setDnsTimeout(int)
      • getDnsRetries

        public int getDnsRetries()
        Gets the number of times that eggPlant Performance will retry a DNS lookup in the event of failure.
        Returns:
        the number of times that eggPlant Performance will retry a DNS lookup in the event of failure
        See Also:
        setDnsRetries(int)
      • getConnectTimeout

        public int getConnectTimeout()
        Gets the time in milliseconds to wait for a TCP connection to be opened, before reporting a failure.
        Returns:
        the time in milliseconds to wait for a TCP connection to be opened, before reporting a failure
        See Also:
        setConnectTimeout(int)
      • getReceiveTimeout

        public int getReceiveTimeout()
        Gets the time in milliseconds to wait for a web server to respond to a request before reporting a failure.
        Returns:
        the time in milliseconds to wait for a web server to respond to a request before reporting a failure
        See Also:
        setReceiveTimeout(int)
      • getSendTimeout

        public int getSendTimeout()
        Gets the time in milliseconds before a sent TCP packet will time-out.
        Returns:
        the time in milliseconds before a sent TCP packet will time-out
        See Also:
        setSendTimeout(int)
      • getConnectRetries

        public int getConnectRetries()
        Gets the number of times to attempt to connect to a web server before reporting a failure.
        Returns:
        the number of times to attempt to connect to a web server before reporting a failure
        See Also:
        setConnectRetries(int)
      • setBufferSize

        public void setBufferSize​(int bufferSize)
        Sets the size of the buffer used when reading TCP data from a socket.
        Parameters:
        bufferSize - the size of the buffer in bytes
        See Also:
        getBufferSize()
      • setDnsTimeout

        public void setDnsTimeout​(int timeout)
        Sets the time in milliseconds before a DNS lookup will time-out.
        Parameters:
        timeout - the time in milliseconds
        See Also:
        getDnsTimeout()
      • setDnsRetries

        public void setDnsRetries​(int retries)
        Sets the number of times that eggPlant Performance will retry a DNS lookup in the event of failure.
        Parameters:
        retries - the number of retries to attempt
        See Also:
        getDnsRetries()
      • setConnectTimeout

        public void setConnectTimeout​(int timeout)
        Sets the time in milliseconds to wait for a TCP connection to be opened, before reporting a failure.
        Parameters:
        timeout - the time in milliseconds
        See Also:
        getConnectTimeout()
      • setReceiveTimeout

        public void setReceiveTimeout​(int timeout)
        Sets the time in milliseconds to wait for a web server to respond to a request before reporting a failure.
        Parameters:
        timeout - the time in milliseconds
        See Also:
        getReceiveTimeout()
      • setSendTimeout

        public void setSendTimeout​(int timeout)
        Sets the time in milliseconds before a sent TCP packet will time-out.
        Parameters:
        timeout - the time in milliseconds
      • setConnectRetries

        public void setConnectRetries​(int retries)
        Sets the number of times to attempt to connect to a web server before reporting a failure.
        Parameters:
        retries - the number of retries to attempt
        See Also:
        getConnectRetries()
      • getLocalIpEndPoint

        public IpEndPoint getLocalIpEndPoint()
                                      throws com.facilita.exception.NotSupportedException
        Gets the local IpEndPoint to use when making a connection to a web server. Usually, it is not necessary to set this property, and each Virtual User will use the same IP address.

        IP Spoofing can be enabled by assigning Virtual Users different local IpEndPoint objects. For more information, search the main Eggplant Performance user guide for "IP Spoofing".

        Note that this method only applies if you are using the Internal HTTP handler.

        Returns:
        the local IpEndPoint to use when making a connection to a web server
        Throws:
        com.facilita.exception.NotSupportedException - either the WinInet or WinHTTP handler is currently in use, for which this method is not supported
        See Also:
        setLocalIpEndPoint(IpEndPoint)
      • setLocalIpEndPoint

        public void setLocalIpEndPoint​(IpEndPoint localIpEndPoint)
                                throws com.facilita.exception.NotSupportedException
        Sets the local IpEndPoint to use when making a connection to a web server. Usually, it is not necessary to set this property, and each Virtual User will use the same IP address.

        IP Spoofing can be enabled by assigning Virtual Users different local IpEndPoint objects. For more information, search the main Eggplant Performance user guide for "IP Spoofing".

        Note that this method only applies if you are using the Internal HTTP handler.

        Parameters:
        localIpEndPoint - the local IpEndPoint to use when making a connection to a web server
        Throws:
        com.facilita.exception.NotSupportedException - either the WinInet or WinHTTP handler is currently in use, for which this method is not supported
        See Also:
        getLocalIpEndPoint()
      • setReadRetries

        public void setReadRetries​(int n)
                            throws com.facilita.exception.NotSupportedException
        Sets the number of times to attempt to read data from the web server before reporting a failure.
        Parameters:
        n - the number of times to attempt to read data from the web server before reporting a failure
        Throws:
        com.facilita.exception.NotSupportedException - either the WinInet or WinHTTP handler is currently in use, for which this method is not supported
        See Also:
        getReadRetries()
      • getReadRetries

        public int getReadRetries()
                           throws com.facilita.exception.NotSupportedException
        Gets the number of times to attempt to read data from the web server before reporting a failure.
        Returns:
        the number of times to attempt to read data from the web server before reporting a failure
        Throws:
        com.facilita.exception.NotSupportedException - either the WinInet or WinHTTP handler is currently in use, for which this method is not supported
        See Also:
        setReadRetries(int)
      • getSSLrenegotiateTime

        public int getSSLrenegotiateTime()
                                  throws com.facilita.exception.NotSupportedException
        Gets the time in milliseconds after which the SSL connection must be renegotiated.
        Returns:
        the time in milliseconds
        Throws:
        com.facilita.exception.NotSupportedException - either the WinInet or WinHTTP handler is currently in use, for which this method is not supported
        See Also:
        setSSLrenegotiateTime(int)
      • setSSLrenegotiateTime

        public void setSSLrenegotiateTime​(int time)
                                   throws com.facilita.exception.NotSupportedException
        Sets the time in milliseconds after which the SSL connection must be renegotiated.
        Parameters:
        time - the time in milliseconds
        Throws:
        com.facilita.exception.NotSupportedException - either the WinInet or WinHTTP handler is currently in use, for which this method is not supported
        See Also:
        getSSLrenegotiateTime()
      • setCertLocation

        public void setCertLocation​(java.lang.String path)
                             throws com.facilita.exception.NotSupportedException
        Sets the location folder or file path for a client certificate.

        This method enables a specific certificate file, or folder containing certificates, to be set. It should be called before any requests to a server that requires a client certificate. This method calls the OpenSSL method SSL_CTX_load_verify_locations(), see http://www.openssl.org/docs/ssl/SSL_CTX_load_verify_locations.html for details of usage.

        If the path is a folder, then the CAfile argument of SSL_CTX_load_verify_locations is NULL. If it is a file, the CApath argument is set to NULL. Certificates must be in PEM format. Other formats can be converted to PEM format:

        e.g. to convert a certificate exported from a browser to PEM format using the OpenSSL utility:

        
         openssl pkcs12 -clcerts -nokeys -out hostcert.pem -in cert.p12
         
        See http://www.openssl.org/ for details.
        Parameters:
        path - the file path or folder to use
        Throws:
        com.facilita.exception.NotSupportedException - either the WinInet or WinHTTP handler is currently in use, for which this method is not supported
        See Also:
        getCertLocation(), isSetCertLocation()
      • isSetCertLocation

        public boolean isSetCertLocation()
                                  throws com.facilita.exception.NotSupportedException
        Returns true if a certificate location has been set.
        Returns:
        true if a certificate location has been set
        Throws:
        com.facilita.exception.NotSupportedException - either the WinInet or WinHTTP handler is currently in use, for which this method is not supported
        See Also:
        setCertLocation(String), getCertLocation()
      • getCertLocation

        public java.lang.String getCertLocation()
                                         throws com.facilita.exception.NotSupportedException
        Gets the location folder or file path for a client certificate.

        A specific certificate file, or folder containing certificates, can be set. It should be set before any requests to a server that requires a client certificate.

        Certificates must be in PEM format. Other formats can be converted to PEM format:

        e.g. to convert a certificate exported from a browser to PEM format using the OpenSSL utility:

        
         openssl pkcs12 -clcerts -nokeys -out hostcert.pem -in cert.p12
         
        See http://www.openssl.org/ for details.
        Returns:
        the location folder or file path for a client certificate
        Throws:
        com.facilita.exception.NotSupportedException - either the WinInet or WinHTTP handler is currently in use, for which this method is not supported
        See Also:
        setCertLocation(String), isSetCertLocation()
      • getDefaultConnectionIdleTimeout

        public int getDefaultConnectionIdleTimeout()
                                            throws com.facilita.exception.NotSupportedException
        Gets the time in milliseconds after which a TCP connection is considered to be idle, and automatically closed.
        Returns:
        the time in milliseconds
        Throws:
        com.facilita.exception.NotSupportedException - either the WinInet or WinHTTP handler is currently in use, for which this method is not supported
        See Also:
        setDefaultConnectionIdleTimeout(int)
      • setDefaultConnectionIdleTimeout

        public void setDefaultConnectionIdleTimeout​(int timeout)
                                             throws com.facilita.exception.NotSupportedException
        Sets the time in milliseconds after which a TCP connection is considered to be idle, and automatically closed.
        Parameters:
        timeout - the time in milliseconds
        Throws:
        com.facilita.exception.NotSupportedException - either the WinInet or WinHTTP handler is currently in use, for which this method is not supported
        See Also:
        getDefaultConnectionIdleTimeout()
      • setCertificateStoreName

        public void setCertificateStoreName​(java.lang.String storeName)
                                     throws com.facilita.exception.NotSupportedException
        Sets the name of the system certificate store in which to search for client certificates.

        As part of the SSL/TLS handshake, a server can request a certificate to authenticate the client (i.e. the virtual user). If you have a client certificate, you can specify its location with this method and setCertificateSubject(String).

        • The default certificate store name is "MY", which corresponds to Certificates - Current User\Personal\Certificates.
        • Another common option is "ROOT" which corresponds to Certificates - Current User\Trusted Root Certification Authorities\Certificates.

        Both of these certificate stores can be viewed by running certmgr.msc, from which you can also add client certificates.

        Note that it is not possible to load client certificates from the Certificates - Local Computer certificate stores (which are viewable by running certlm.msc).

        Parameters:
        storeName - the name of the system certificate store, e.g. "MY" or "ROOT"
        Throws:
        com.facilita.exception.NotSupportedException - the Internal HTTP handler is currently in use, for which this method is not supported
        See Also:
        getCertificateStoreName(), setCertificateSubject(String), setCertificateDisplay(boolean), setEnableOptionalClientCertificates(boolean)
      • setCertificateDisplay

        public void setCertificateDisplay​(boolean display)
                                   throws com.facilita.exception.NotSupportedException
        Sets whether client certificate names should be written to the event log. This can be useful for debugging SSL/TLS client certificate issues.
        Parameters:
        display - true if client certificate names should be written to the event log
        Throws:
        com.facilita.exception.NotSupportedException - the Internal HTTP handler is currently in use, for which this method is not supported
        See Also:
        getCertificateDisplay(), setCertificateStoreName(String), setCertificateSubject(String), setEnableOptionalClientCertificates(boolean)
      • setEnableOptionalClientCertificates

        public void setEnableOptionalClientCertificates​(boolean enable)
                                                 throws com.facilita.exception.NotSupportedException
        Sets whether client certificates can be optional, in case the server requests a client certificate but doesn't require one.

        As part of the SSL/TLS handshake, a server can request a certificate to authenticate the client (i.e. the virtual user). If you have a client certificate, you can use the other certificate methods to specify its location. However if you know the server doesn't require a client certificate, you can set this flag. If getCertificateSubject() returns an empty string or a client certificate cannot otherwise be located, the handshake will continue without one.

        Parameters:
        enable - true if SSL/TLS handshakes should be retried without a client certificate
        Throws:
        com.facilita.exception.NotSupportedException - either the WinInet or Internal HTTP handler is currently in use, for which this method is not supported
        See Also:
        getEnableOptionalClientCertificates(), setCertificateStoreName(String), setCertificateSubject(String), setCertificateDisplay(boolean)
      • getCertificateStoreName

        public java.lang.String getCertificateStoreName()
                                                 throws com.facilita.exception.NotSupportedException
        Gets the name of the system certificate store in which to search for client certificates.

        As part of the SSL/TLS handshake, a server can request a certificate to authenticate the client (i.e. the virtual user). If you have a client certificate, you can specify its location with setCertificateStoreName(String) and setCertificateSubject(String).

        • The default certificate store name is "MY", which corresponds to Certificates - Current User\Personal\Certificates.
        • Another common option is "ROOT" which corresponds to Certificates - Current User\Trusted Root Certification Authorities\Certificates.

        Both of these certificate stores can be viewed by running certmgr.msc, from which you can also add client certificates.

        Note that it is not possible to load client certificates from the Certificates - Local Computer certificate stores (which are viewable by running certlm.msc).

        Returns:
        the name of the system certificate store, e.g. "MY" or "ROOT"
        Throws:
        com.facilita.exception.NotSupportedException - the Internal HTTP handler is currently in use, for which this method is not supported
        See Also:
        setCertificateStoreName(String), getCertificateSubject(), getCertificateDisplay(), getEnableOptionalClientCertificates()
      • getCertificateSubject

        public java.lang.String getCertificateSubject()
                                               throws com.facilita.exception.NotSupportedException
        Gets the subject to search for when selecting a client certificate.

        For more information about the certificate stores and how to view/add client certificates, see getCertificateStoreName(). The first certificate in the store whose subject contains the specified text will be selected.

        Returns:
        the subject fragment of the certificate to select
        Throws:
        com.facilita.exception.NotSupportedException - the Internal HTTP handler is currently in use, for which this method is not supported
        See Also:
        setCertificateSubject(String), getCertificateStoreName(), getCertificateDisplay(), getEnableOptionalClientCertificates()
      • getCertificateDisplay

        public boolean getCertificateDisplay()
                                      throws com.facilita.exception.NotSupportedException
        Returns true if client certificate names will be written to the event log. This can be useful for debugging SSL/TLS client certificate issues.
        Returns:
        true if client certificate names will be written to the event log
        Throws:
        com.facilita.exception.NotSupportedException - the Internal HTTP handler is currently in use, for which this method is not supported
        See Also:
        setCertificateDisplay(boolean), getCertificateStoreName(), getCertificateSubject(), getEnableOptionalClientCertificates()
      • getEnableOptionalClientCertificates

        public boolean getEnableOptionalClientCertificates()
                                                    throws com.facilita.exception.NotSupportedException
        Returns true if client certificates can be optional, in case the server requests a client certificate but doesn't require one.

        As part of the SSL/TLS handshake, a server can request a certificate to authenticate the client (i.e. the virtual user). If you have a client certificate, you can use the other certificate methods to specify its location. However if you know the server doesn't require a client certificate, you can set this flag. If getCertificateSubject() returns an empty string or a client certificate cannot otherwise be located, the handshake will continue without one.

        Returns:
        true if SSL/TLS handshakes should be retried without a client certificate
        Throws:
        com.facilita.exception.NotSupportedException - either the WinInet or Internal HTTP handler is currently in use, for which this method is not supported
        See Also:
        setEnableOptionalClientCertificates(boolean), getCertificateStoreName(), getCertificateSubject(), getCertificateDisplay()
      • setAccess

        public void setAccess​(int accessType,
                              java.lang.String proxyServer,
                              java.lang.String proxyBypass)
                       throws com.facilita.exception.NotSupportedException
        Sets the dwAccessType, lpszProxyName and lpszProxyBypass parameters to be passed to InternetOpen() used by WinInet/WinHTTP.
        Parameters:
        accessType - possible values are documented at Microsoft MSDN InternetOpen function
        proxyServer - the proxy server address when accessType is set to INTERNET_OPEN_TYPE_PROXY. This must not be an empty String
        proxyBypass - an optional list of host names or IP addresses, or both, that should not be routed through the proxy when accessType set to INTERNET_OPEN_TYPE_PROXY. This must not be an empty String
        Throws:
        com.facilita.exception.NotSupportedException - either the WinInet or WinHTTP handler is currently in use, for which this method is not supported
      • getAccessType

        public int getAccessType()
                          throws com.facilita.exception.NotSupportedException
        Gets the dwAccessType parameter to be passed to InternetOpen() used by WinInet/WinHTTP.

        To set the dwAccessType parameter, call the setAccess(int, String, String) method.

        Returns:
        the dwAccessType parameter
        Throws:
        com.facilita.exception.NotSupportedException - either the WinInet or WinHTTP handler is currently in use, for which this method is not supported
        See Also:
        setAccess(int, String, String)
      • getProxyServer

        public java.lang.String getProxyServer()
                                        throws com.facilita.exception.NotSupportedException
        Gets the lpszProxyName parameter to be passed to InternetOpen() used by WinInet/WinHTTP.

        To set the lpszProxyName parameter, call the setAccess(int, String, String) method.

        Returns:
        the lpszProxyName parameter
        Throws:
        com.facilita.exception.NotSupportedException - either the WinInet or WinHTTP handler is currently in use, for which this method is not supported
        See Also:
        setAccess(int, String, String)
      • getProxyBypass

        public java.lang.String getProxyBypass()
                                        throws com.facilita.exception.NotSupportedException
        Gets the lpszProxyBypass parameter to be passed to InternetOpen() used by WinInet/WinHTTP.

        To set the lpszProxyBypass parameter, call the setAccess(int, String, String) method.

        Returns:
        the lpszProxyBypass parameter
        Throws:
        com.facilita.exception.NotSupportedException - either the WinInet or WinHTTP handler is currently in use, for which this method is not supported
        See Also:
        setAccess(int, String, String)
      • getConnectionsPerServer

        public int getConnectionsPerServer()
                                    throws com.facilita.exception.NotSupportedException
        Gets the maximum number of connections allowed per server for a WinHTTP handler. The default value is INFINITE.
        Returns:
        the maximum number of connections allowed per server for a WinHTTP handler
        Throws:
        com.facilita.exception.NotSupportedException - this method is only supported if the WinHTTP handler is currently in use
        See Also:
        setConnectionsPerServer(int)
      • setConnectionsPerServer

        public void setConnectionsPerServer​(int connections)
                                     throws com.facilita.exception.NotSupportedException
        Sets the maximum number of connections allowed per server for a WinHTTP handler. The default value is INFINITE.
        Parameters:
        connections - the maximum number of connections allowed per server for a WinHTTP handler
        Throws:
        com.facilita.exception.NotSupportedException - this method is only supported if the WinHTTP handler is currently in use
        See Also:
        getConnectionsPerServer()
      • closeAllConnections

        public void closeAllConnections()
        Closes all of the open TCP/IP connections to the web server.
      • setDefaultCharactersAllowedInPostedForm

        public void setDefaultCharactersAllowedInPostedForm​(java.lang.String charactersAllowedInPostedForm)
        Set the characters that, by default, will NOT be percent-encoded when a Form is sent to the web server using a POST request.

        By default, a character will be percent-encoded within a form if it is:

        • Outside the ASCII range OR
        • Not an alpha-numeric character AND not in this list of allowed characters
        By default, the allowed list of characters is as follows:
        • ' ' - space
        • '-' - hyphen
        • '_' - underscore
        • '.' - full stop
        • '*' - asterisk
        Parameters:
        charactersAllowedInPostedForm - the list of characters not to percent-encode
        See Also:
        Coder.getDefaultCharactersAllowedInPostedForm(), getDefaultCharactersAllowedInPostedForm(), Request.setCharactersAllowedInPostedForm(String), Request.setMessageBody(Form)
      • isLoggingSuspended

        public boolean isLoggingSuspended()
        Returns true if detailed HTTP logging has been suspended for this Virtual User.
        Returns:
        true if detailed HTTP logging has been suspended for this Virtual User
        See Also:
        suspendLogging(), resumeLogging()
      • suspendLogging

        public void suspendLogging()
        Suspends detailed HTTP logging for this Virtual User.
        See Also:
        resumeLogging()
      • resumeLogging

        public void resumeLogging()
        Resumes detailed HTTP logging for this Virtual User.
        See Also:
        suspendLogging()
      • isDynatraceIntegrationEnabled

        public boolean isDynatraceIntegrationEnabled()
        Returns true if dynaTrace integration is enabled. When dynaTrace integration is enabled, a special dynaTrace HTTP header is sent with each HTTP request.
        Returns:
        true if dynaTrace integration is enabled
        See Also:
        setDynatraceIntegrationEnabled(boolean)
      • setDynatraceIntegrationEnabled

        public void setDynatraceIntegrationEnabled​(boolean value)
        Sets whether or not dynaTrace integration is enabled. When dynaTrace integration is enabled, a special dynaTrace HTTP header is sent with each HTTP request.
        Parameters:
        value - true to enable dynaTrace integration, false to disable it
        See Also:
        isDynatraceIntegrationEnabled()
      • responseWithNoExpiryInformationIsFresh

        public boolean responseWithNoExpiryInformationIsFresh()
        Gets a value that indicates whether a response from a web server that does not contains any expiry information (such as an "Expires" or "Cache-Control, max-age" header) is treated as expired or not.

        Usually, a response from a web server will have an "Expires" header, which gives the date/time after which the response is considered stale. However, if a response does not contain any expiry information, then it is up to the browser to decide whether or not a response should be considered fresh or not. Most browsers wil consider the response to be stale, and so will re-request it from the server. However, there may be cases where you want th opposite behaviour (i.e. consider the response to be fresh and so do not re-request it). This can be achieved by setting this property to true. The default value for this property is false.

        Returns:
        true if a response with no expiry information is considered to be fresh.
        See Also:
        setResponseWithNoExpiryInformationIsFresh(boolean)
      • setResponseWithNoExpiryInformationIsFresh

        public void setResponseWithNoExpiryInformationIsFresh​(boolean value)
        Sets a value that indicates whether a response from a web server that does not contains any expiry information (such as an "Expires" or "Cache-Control, max-age" header) is treated as expired or not.

        Usually, a response from a web server will have an "Expires" header, which gives the date/time after which the response is considered stale. However, if a response does not contain any expiry information, then it is up to the browser to decide whether or not a response should be considered fresh or not. Most browsers will consider the response to be stale, and so will re-request it from the server. However, there may be cases where you want the opposite behaviour (i.e. consider the response to be fresh and so do not re-request it). This can be achieved by setting this property to true. The default value for this property is false.

        Parameters:
        value - true if a response with no expiry information should be considered to be fresh.
        See Also:
        responseWithNoExpiryInformationIsFresh()
      • createWebSocket

        public WebSocket createWebSocket​(Url url,
                                         int reference)
        Creates a WebSocket object that can be used to send/receive WebSocket messages to/from the web server.

        The WebSocket is not opened until the WebSocket.open() method is called.

        Parameters:
        url - The Url that the WebSocket handshake request should be sent to.
        reference - A unique identifier that can be used to track this WebSocket.
        Returns:
        The new WebSocket object.