未在selendroid服务器中配置所请求的受测试应用程序

时间:2015-07-08 06:27:42

标签: android selenium selendroid

@BeforeSuite
public void setUp() throws Exception {
    //Start selendroid-standalone during test
    SelendroidConfiguration config = new SelendroidConfiguration();

    // Add the selendroid-test-app to the standalone server
    config.addSupportedApp("F:\\Seleandriod\\OFCOne.apk");

    //start the standalone server
    SelendroidLauncher selendroidServer = new SelendroidLauncher(config);
    selendroidServer.launchSelendroid();

    // Create the selendroid capabilities
    SelendroidCapabilities capa = new SelendroidCapabilities();

    // Specify to use selendroid's test app
    capa.setAut("io.selendroid.androiddriver:0.11.0");

    // Specify to use the Android device API 19
    capa.setPlatformVersion(DeviceTargetPlatform.ANDROID19);

    // Don't request simulator, use real device
    capa.setEmulator(false);

    //capa.wait(10000000);

    // Create instance of Selendroid Driver
    driver = new SelendroidDriver(capa);

我们正在使用 HYBRID cordova app , 执行失败的行SelendroidDriver(capa);初始化时出现以下错误:

  

"未在selendroid中配置所请求的受测试应用程序   服务器"

我们正在使用 selendroid-standalone-0.11.0-with-dependencies版本

我们在命令行上运行:

java -jar selendroid-standalone-0.11.0-with-dependencies -aut OFCOne.apk

发出以下错误:

  

" SEVERE:构建服务器时出错:apk的基本包名称   无法提取resigned-OFCOne.apk。"

请给我一些解决此错误的建议。

2 个答案:

答案 0 :(得分:0)

  capa.setAut("io.selendroid.androiddriver:0.11.0");

这应该是你的appId而不是selendroid的appId。很可能你的appId将是your_app_package_name:version。运用 http://localhost:4444/wd/hub/status您可以获得appId,第一个appId不是您的应用程序,它是您设备上安装的selendroid服务器驱动程序应用程序的appId。第二个appId将是你的appId。请使用它代替您在上面的代码行中使用的内容。

答案 1 :(得分:0)

我刚遇到同样的问题。原因是.apk文件的路径错误。而且我不确定绝对路径,我使用相对路径

def i=0
// Recursive Function to check response again and again
while( slurperresponse.products.status!= "complete" ) {
    project = testRunner.getTestCase().getTestSuite().getProject().getWorkspace().getProjectByName("REST Project 1")
    testSuite = project.getTestSuiteByName("Product(PIM-API)");
    testCase = testSuite.getTestCaseByName("Checking_Responses");
    runner = testCase.run(new com.eviware.soapui.support.types.StringToObjectMap(), false);
    sleep(new Random().nextInt(10) * 2000)
    log.info (slurperresponse.products.status)

// My other testcase setting the latest value of my required response in global properties and in below code I am checking the latest value

    slurperresponse.products.status = com.eviware.soapui.SoapUI.globalProperties.getPropertyValue( "Status_of_Product_import_request" )
    i++
    log.info (i)
    if(i==5)
    {
        assert false
        }
}
assert true

希望这有帮助!

相关问题