Appium support for iOS wifi connection


#1

In my project we need to connect a usb to the iOS device. So we cant use the usb cable for running the Appium Automation.


#2

Please need a urgent help for Appium genius guys.


#3

Please help me on this


#4

i am able to do with ios11 and xcode 9


#5

@Jitu1888
Can you please share how to wifi on/off in iOS device


#6

Create a iOSdriver but pass the bundle id as com.apple.Preferences
This will open the setting page and you can do any action in setting page.
Code:
public static void main(String[] args) throws Exception {

	IOSDriver driver = null;
	DesiredCapabilities capabilities = new DesiredCapabilities();
	capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME, "XCUITest");
	capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, "iOS");
	capabilities.setCapability(MobileCapabilityType.APPIUM_VERSION, "1.6.5");
	capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "10.0");
	capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "RDEiPhone");
	capabilities.setCapability("newCommandTimeout", 60*5);
	capabilities.setCapability("--session-override", true);
	//desiredCapabilities.setCapability("preventWDAAttachments", true);
	//capabilities.setCapability(MobileCapabilityType.LAUNCH_TIMEOUT, 500000);
	capabilities.setCapability("showXcodeLog", false);
	capabilities.setCapability("xcodeOrgId", "Pass your developer team id");
	capabilities.setCapability("xcodeSigningId", "iPhone Developer");
	capabilities.setCapability(MobileCapabilityType.UDID, "e010e19ee4428664afc53d50999c138c861ea22e");
	//capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT , 2000);
	//capabilities.setCapability(MobileCapabilityType.APP , "/Users/rderpg/Desktop/sukrit_chill_debug/19-817/iXpand Base Auto-3.ipa");
	capabilities.setCapability("bundleId", "com.apple.Preferences");
	//capabilities.setCapability("xcodeConfigFile", "/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/Configurations/ProjectSettings.xcconfig");
	capabilities.setCapability("usePrebuiltWDA", true);
	capabilities.setCapability("clearSystemFiles", true);
	//capabilities.setCapability("noReset", true);
	capabilities.setCapability("updatedWDABundleId", "com.facebook.WebDriverAgentAppiumTest");
	//launchAppiumServer1();	
	//launchAppiumServer();
	try {

driver = new IOSDriver(new URL(“http://127.0.0.1:4723/wd/hub”),capabilities);
System.out.println(“jitu”);
driver.findElement(By.id(“Wi-Fi”)).click();
driver.findElement(By.xpath("//XCUIElementTypeSwitch")).click();

	} catch (Exception e) {

		System.out.println(e);


	}



}

#7

You can check the switch attribute value.
1: it is ON.
0: it is OFF


#8

#9

Please checkout this youtube video to automate iOS application without cable.


#10

@Swapan_Chhabra : Wi-Fi is getting disconnected after sometime.

Please let me know how to avoid the disconnection