简体   繁体   English

如果由AppiumServiceBuilder启动appium服务器,如何启用--no-reset

[英]How to enable --no-reset if appium server is started by AppiumServiceBuilder

I have started Appium Server using AppiumServerBuilder 我已经使用AppiumServerBuilder启动了Appium Server

service = AppiumDriverLocalService
                    .buildService(new AppiumServiceBuilder()
                    .usingDriverExecutable(new File(nodeJsExecutable))
                    .withAppiumJS(new File(appiumJsExecutable))
                    .withIPAddress(appiumServerAddress)
                    .usingPort(appiumServerPort));

Now Appium Server gets started with default --full-reset capability, causing the app to reset every time on each run. 现在,Appium Server开始使用默认的--full-reset功能,从而使该应用在每次运行时每次都重置。 I need to set --no-reset for Appium Server so appium doesn't re install app everytime . 我需要为Appium Server设置--no-reset,以便appium不会每次都重新安装app。 How can I do that here? 我该怎么办?

You can explicitly set "noResetValue" appium capability which accepts boolean value, true/false 您可以显式设置“ noResetValue” appium功能,该功能接受布尔值true / false

when set to true , it prevents the app from re-installing each time, java example: 设置为true时,它会阻止应用程序每次重新安装,例如java:

capabilities = new DesiredCapabilities();    
capabilities.setCapability("noResetValue","true"); 

You will most likely need to set any such capabilities with the .withCapabilities method: http://appium.github.io/java-client/io/appium/java_client/service/local/AppiumServiceBuilder.html#withCapabilities(org.openqa.selenium.remote.DesiredCapabilities) 您很可能需要使用.withCapabilities方法设置任何此类功能: http : .withCapabilities 。 selenium.remote.DesiredCapabilities)

fullReset shouldn't be enabled by default in any case. 在任何情况下,均不应默认启用fullReset。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM