尝试使用Appium驱动程序进行连接时出现未知主机异常

时间:2017-09-01 16:53:37

标签: selenium appium

我们正在尝试使用Appium驱动程序连接到perfecto移动云。但得到未知的主机异常。尽管可以在浏览器中访问URL,但在ping时不能访问。以下是网址: citi.perfectomobile.com

添加我们正在尝试的代码段

package appiumDemo;
import java.net.MalformedURLException;
import java.net.URL;
import org.openqa.selenium.remote.DesiredCapabilities;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.ios.IOSDriver;

public class FirstDemo {
    static AppiumDriver driver;
    static String host="xyz.perfectomobile.com"; 
    public static void main(String[] args) throws MalformedURLException {
        DesiredCapabilities capabilities = new DesiredCapabilities();
         capabilities.setCapability("platformName", "iOS");
         capabilities.setCapability("platformVersion", "10.2.1");
         capabilities.setCapability("manufacturer", "Apple");
         capabilities.setCapability("model", "iPhone-5S");
         capabilities.setCapability("user","k*******@****.com");
         capabilities.setCapability("password","********");
         driver = new IOSDriver(new URL("http://" + host + "/nexperience/perfectomobile/wd/hub"), capabilities);
    }
}

以下是错误跟踪

Exception in thread "main" org.openqa.selenium.WebDriverException: java.net.UnknownHostException: xyz.perfectomobile.com
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'C*******', ip: '169.***.***.***', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_40'
Driver info: driver.version: IOSDriver
    at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:104)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637)
    at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
    at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
    at io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:250)
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:236)
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:137)
    at io.appium.java_client.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:38)
    at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:87)
    at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:111)
    at io.appium.java_client.ios.IOSDriver.<init>(IOSDriver.java:78)
    at appiumDemo.FirstDemo.main(FirstDemo.java:25)
Caused by: java.net.UnknownHostException: xyz.perfectomobile.com
    at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
    at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:907)
    at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1302)
    at java.net.InetAddress.getAllByName0(InetAddress.java:1255)
    at java.net.InetAddress.getAllByName(InetAddress.java:1171)
    at java.net.InetAddress.getAllByName(InetAddress.java:1105)
    at org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45)
    at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:112)
    at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:359)
    at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381)
    at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237)
    at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
    at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
    at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111)
    at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
    at org.openqa.selenium.remote.internal.ApacheHttpClient.fallBackExecute(ApacheHttpClient.java:139)
    at org.openqa.selenium.remote.internal.ApacheHttpClient.execute(ApacheHttpClient.java:87)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:343)
    at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:159)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)
    at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:89)
    ... 12 more

0 个答案:

没有答案