Java????Appium server start/stop
???????????? ???????[ 2016/1/14 10:34:17 ] ??????????????? ???????????
???????Java runtime class
?????????????command?? ?????в??????????????
????????????????в???? ??????????????code
???????????????????????????????
???????????????????????????????
????????????????commons-exec??project??????????
????????????????????÷???????У???????????:
??????????????????????handler DefaultExecuteResultHandler???????????????????????
????????????watchdog????????????????timeout???60s
????????????????????????????1????????г??
?????????????????????waitfor time???????????????
resultHandler.waitFor(5000);
publicstaticStringAPPIUMSERVERSTART="C:\ProgramFiles(x86)\Appium\node_modules\.bin\appium.cmd";
publicstaticvoidstartServer()throwsIOException??InterruptedException
{
startServer("4723");
//RuntimeExecappiumObj=newRuntimeExec();
//appiumObj.excuteCMD(APPIUMSERVERSTART);
DefaultExecuteResultHandlerresultHandler=newDefaultExecuteResultHandler();
CommandLinecommandLine=CommandLine.parse(APPIUMSERVERSTART);
ExecuteWatchdogdog=newExecuteWatchdog(60*1000);
Executorexecutor=newDefaultExecutor();
executor.setExitValue(1);
executor.setWatchdog(dog);
executor.execute(commandLine??resultHandler);
resultHandler.waitFor(5000);
System.out.println("Appiumserverstart");
}
????????code?????????????port???Appium server ?????????Appium???????????????????
???????????????????????????????????
??????????????command line
cmd /c echo off & FOR /F "usebackq tokens=5" %a in (`netstat -nao ^| findstr /R /C:"4723"`) do (FOR /F "usebackq" %b in (`TASKLIST /FI "PID eq %a" ^| findstr /I node.exe`) do taskkill /F /PID %a)
/**
* @author Young
* @param appiumServicePort
* @throws ExecuteException
* @throws IOException
*/
public static void stopAppiumServer(String appiumServicePort) throws ExecuteException?? IOException
{
ExectorUtils.runWithWatchDog("cmd /c echo off & FOR /F "usebackq tokens=5" %a in"
+ " (`netstat -nao ^| findstr /R /C:"" + appiumServicePort + ""`) do (FOR /F "usebackq" %b in"
+ " (`TASKLIST /FI "PID eq %a" ^| findstr /I node.exe`) do taskkill /F /PID %a)");
}
?????????????????test case????????Appium server?????????????????
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
Java???????????Щ???????????????Java????????????????Java?б???Map????????Java Web???????????????Java??????????????д?????Java????????7???????????????????????(java .net ?????)???Java??????????Python??????Java webdriver??λ????????′????е?????Java??д??????????????????Java???????????????JavaScript????????????Java?????????????????? Java???????10??????????????Java?м????????????????java???????ü???????????м???????????????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????