I’m looking for a toolkit to:
- open some native ios apps and third party apps(Safar, Facebook for example)
- scroll the app and take a fullpage screenshot
- send back screenshot to desktop and upload
Maybe Appium is a solution.
Now I’m connecting my iPhone and write a simple testcase with webdriver.io:
`
const { remote } = require(‘webdriverio’);
// iOS
const capabilities = {
‘platformName’: ‘iOS’,
‘appium:automationName’: ‘XCUITest’,
‘appium:deviceName’: ‘iPhone’,
‘appium:platformVersion’: ‘11.3’,
‘appium:udid’: ‘{Indentifier shown on xCode device info area}’,
‘appium:xcodeOrgId’: ‘{my apple id login account}’,
‘appium:xcodeSigningId’: ‘Apple Developer’,
// ‘appium:xcodeSigningId’: ‘iPhone Developer’,
‘appium:showXcodeLog’: true,
};
const wdOpt = {
host: ‘localhost’,
port: 4723,
logLevel: ‘info’,
capabilities,
};
async function runTest() {
const driver = await remote(wdOpt);
try {
const batteryItem = await driver.$(’//*[@text=“Battery”]’);
await batteryItem.click();
} finally {
await driver.pause(5000);
await driver.deleteSession();
}
}
runTest().catch(console.error);
`
But I just got the following errors:
2023-12-20T12:50:28.718Z ERROR webdriver: Request failed with status 500 due to unknown error: An unknown server-side error occurred while processing the command. Original error: Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 70. This usually indicates an issue with the local Xcode setup or WebDriverAgent project configuration or the driver-to-platform version mismatch. Consider checking the WebDriverAgent configuration guide for real iOS devices at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md.. Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device.
2023-12-20T12:50:28.719Z ERROR webdriver: unknown error: An unknown server-side error occurred while processing the command. Original error: Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 70. This usually indicates an issue with the local Xcode setup or WebDriverAgent project configuration or the driver-to-platform version mismatch. Consider checking the WebDriverAgent configuration guide for real iOS devices at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md.. Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device.
at getErrorFromResponseBody (file:///Users/amir/Documents/email%20simulation/simulate-mobile/node_modules/.pnpm/[email protected]/node_modules/webdriver/build/utils.js:195:12)
at NodeJSRequest._request (file:///Users/amir/Documents/email%20simulation/simulate-mobile/node_modules/.pnpm/[email protected]/node_modules/webdriver/build/request/index.js:193:23)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async startWebDriverSession (file:///Users/amir/Documents/email%20simulation/simulate-mobile/node_modules/.pnpm/[email protected]/node_modules/webdriver/build/utils.js:64:20)
at async Function.newSession (file:///Users/amir/Documents/email%20simulation/simulate-mobile/node_modules/.pnpm/[email protected]/node_modules/webdriver/build/index.js:19:45)
at async remote (file:///Users/amir/Documents/email%20simulation/simulate-mobile/node_modules/.pnpm/[email protected][email protected]/node_modules/webdriverio/build/index.js:45:22)
at async runTest (/Users/amir/Documents/email simulation/simulate-mobile/src/index.ts:23:18)
Error: Failed to create session.
An unknown server-side error occurred while processing the command. Original error: Unable to launch WebDriverAgent because of xcodebuild failure: xcodebuild failed with code 70. This usually indicates an issue with the local Xcode setup or WebDriverAgent project configuration or the driver-to-platform version mismatch. Consider checking the WebDriverAgent configuration guide for real iOS devices at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md.. Make sure you follow the tutorial at https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md. Try to remove the WebDriverAgentRunner application from the device if it is installed and reboot the device.
at startWebDriverSession (file:///Users/amir/Documents/email%20simulation/simulate-mobile/node_modules/.pnpm/[email protected]/node_modules/webdriver/build/utils.js:69:15)
at processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Function.newSession (file:///Users/amir/Documents/email%20simulation/simulate-mobile/node_modules/.pnpm/[email protected]/node_modules/webdriver/build/index.js:19:45)
at async remote (file:///Users/amir/Documents/email%20simulation/simulate-mobile/node_modules/.pnpm/[email protected][email protected]/node_modules/webdriverio/build/index.js:45:22)
at async runTest (/Users/amir/Documents/email simulation/simulate-mobile/src/index.ts:23:18)
sh: line 0: fg: no job control
ELIFECYCLE Command failed with exit code 1.
and the log is streaming out repeatly. And my versions:
xCode: 13.2.1
xcuitest: 5.12.2
iPhone: ios 11.3
My question is
- Is xcodeOrgId necessary and must be the “teamId” of Apple Developer Program? Does that mean I have to pay $99 first ? I have tried Apple ID and it didn’t work.
- It seems Appium can’t automate on thirty party app. Does system api calls can fulfill my requirements.