All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nordstrom.automation.selenium.exceptions.UnknownGridHostException Maven / Gradle / Ivy

Go to download

Selenium3 Foundation is an automation framework designed to extend and enhance the capabilities provided by Selenium 3.0 (WebDriver).

There is a newer version: 1.0.4
Show newest version
package com.nordstrom.automation.selenium.exceptions;

import java.net.UnknownHostException;

/**
 * This exception indicates that the configured Selenium Grid server host name couldn't be resolved to an IP address.
 */
public class UnknownGridHostException extends RuntimeException {

    private static final long serialVersionUID = -3037697283479571401L;
    private static final String TEMPLATE = "Specified Selenium Grid %s host '%s' was not found";

    /**
     * Constructor for {@code unknown host} exception with the specified role and host name.
     * 
     * @param role Grid server role specifier ({@code hub} or {@code node})
     * @param hostName Grid server host name
     * @param cause the cause of this exception
     */
    public UnknownGridHostException(String role, String hostName, UnknownHostException cause) {
        super(getMessage(role, hostName), cause);
    }
    
    /**
     * Get exception message to the specified role and host name.
     * 
     * @param role Grid server role specifier ({@code hub} or {@code node})
     * @param hostName Grid server host name
     * @return exception message to the specified role and host name
     */
    private static String getMessage(String role, String hostName) {
        return String.format(TEMPLATE, role, hostName);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy