Appium Multi-machine parallel test

Source: Internet
Author: User
Tags appium

save time by requiring parallel testing of multiple models in real-world applicationsThe idea of multi-machine testingstart multiple Appium servers interacting with multiple machines (both Android and iOS) Note: Be sure to use node to install the Appium command line and use the Appium command to start multiple servicesSpecify the server port number when you start the command, and the port numbers that interact with the client The following commands are started in the background, using the background startup mode of the Mac [Nohup command &], if the Windows machine uses the [start/b command]Android Multi-machine server Start command
Startservercmd ="nohup appium--session-override-a"+ Address +"- P"+appium_port +"-BP"+Bootstrap_port+"--selendroid-port"+selendroid_port+"--chromedriver-port"+chromedriver_port+"- u"+deviceid+" "+"--no-reset &"
 Description:Address: Start server addresses, if not specified as 0.0.0.0Appium_port: Port number of the server that is started, default 4723Bootstrap_port: The port number that interacts with the higher version (4.2 and above) of the Android machine, the default 3724Selendroid_port: The port number that interacts with the lower version (below 4.2) of the Android machine, the default 8080Chromedriver_port: Port number to interact with Chrome browser, default 9516DeviceID: ID of the device (ADB devices view) Note: The Android multi-machine boot server must specify the-u parameter, otherwise it will be thrown wrong when running on Windows Server startup commands for iOS multi-machine
"""" +appium_port+"  --webdriveragent-port" +webdriveragent_port
Description:Address: Start server addresses, if not specified as 0.0.0.0Appium_port: Port number of the server that is startedWebdriveragent_port: The port number of the webdriveragent that interacts with the iOS client, the default 8010multi-process Start server command, client connectionMulti- machine testing with multiple processesdefines an incremental increment, in which each process increments this increment on the base port number, guaranteeing that the port number of each server does not conflict The following is a multi-process code, devices is the DeviceID list for the connected phone, Testsuit () is the case entry to be executed 
if __name__=="__main__":    ifdevices = =[]: Log (). log ("Insert your phone first and then test it. Currently required mobile phone system:"+Optionsystem) sys.exit ()ifLen (Devices) = = 1: Testsuit ()Else:         fromMultiprocessingImportProcess port_d=1#the difference between each port number          forDeviceIDinchDevices:t=process (Target=testsuit, args=(Port_d,)) T.start () Port_d=port_d+1
 Note: Port_d is the fixed increment above, through which we can add to the base port number (the base port number to write to a common variable, such as Appium server with 4723) When you start the server, you can connect to the server by using a different Appium server port number.
Webdriver. Remote ('http://127.0.0.1:'+appiumport+'/wd/hub', desired_ Caps
 Note: Starting a multi-process in Windows must write a multi-process connection to the "if __name__ = =" __main__ ":" Below, otherwise the webdriver will be rejected if the connection is initiated

Appium Multi-machine parallel test

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.