无法通过eclipse连接perfecto mobile

时间:2015-02-23 05:29:33

标签: eclipse

我正在尝试使用perfectomobiles测试云块,虽然在eclipse中测试用例,我在Eclipse中添加了Perfecto移动插件,同时创建了一个项目,我给出了以下详细信息

云:mobilecloud.perfectomobile.com,用户名和密码

创建项目后,我们没有获得任何MobileCloud视图,那些MobileCloud Recording和MobileCloud Dashboard选项卡都是空的。我没有站在我们需要添加手机的地方(我想我们无法连接到perfectomobile.com)

然后,我尝试通过以下代码连接

MobileDriver driver = new MobileDriver("mobilecloud.perfectomobile.com","username","password");


        try {
         // write your code here
            IMobileDevice device = driver.getDevice("3152168C4EAA1E2A5DE93CF7B89222720E3A62E0");
            device.open();
            IMobileWebDriver webDriver = device.getDOMDriver("google.com");
            webDriver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
            webDriver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
            webDriver.findElement(By.xpath("(//input[@id=\"lst-ib\"])[1]")).sendKeys("Perfecto Mobile");
            webDriver.findElement(By.xpath("(//button[@id=\"tsbb\"])[1]")).click();

}

但是,我正如下面的例外

10:40:39.569 [main] ERROR c.p.selenium.util.EclipseConnector - Failed to connect to MobileCloud for Eclipse plugin on host: localhost and port: 3287. Possible reasons are: The code doesn't run in Eclipse or the user doesn't have ECLIPSE role or the MobileCloud recording view is not open. In these cases use the MobileDriver constructor that receives the host, user and password.
java.net.ConnectException: Connection refused
    at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1.7.0_55]
    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) ~[na:1.7.0_55]
    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) ~[na:1.7.0_55]
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) ~[na:1.7.0_55]
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.7.0_55]
    at java.net.Socket.connect(Socket.java:579) ~[na:1.7.0_55]
    at java.net.Socket.connect(Socket.java:528) ~[na:1.7.0_55]
    at java.net.Socket.<init>(Socket.java:425) ~[na:1.7.0_55]
    at java.net.Socket.<init>(Socket.java:208) ~[na:1.7.0_55]
    at com.perfectomobile.selenium.util.EclipseConnector.<init>(EclipseConnector.java:34) ~[pm-selenium-3.5.0.000.jar:na]
    at com.perfectomobile.selenium.MobileDriver.initWithEclipseParams(MobileDriver.java:79) [pm-selenium-3.5.0.000.jar:na]
    at com.perfectomobile.selenium.MobileDriver.<init>(MobileDriver.java:64) [pm-selenium-3.5.0.000.jar:na]
    at com.perfectomobile.selenium.MobileDriver.<init>(MobileDriver.java:60) [pm-selenium-3.5.0.000.jar:na]
    at MobileTest.main(MobileTest.java:42) [bin/:na]

任何人都可以帮助我

1 个答案:

答案 0 :(得分:0)

我相信您的Perfecto移动帐户没有添加Eclipse角色(或许可证)(是的,他们对Eclipse有这样的东西)。联系支持人员以获取它。我之前遇到过同样的问题。