[英]Ios app automation using a simulator
public static AppiumDriver wd;
public static void main(String[] args) throws IOException {
// TODO Auto-generated method stub
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("appium-version", "1.0");
capabilities.setCapability("platformName", "iOS");
capabilities.setCapability("platformversion", "8.3");
capabilities.setCapability("deviceName", "iPhone5");
// capabilities.setCapability("app", "CustomFurnish");
File appDir = new File("\\Users\\cloudgust\\dev\\bluebox\\iphone-app\\CustomFurnish.xcodeproj");
File app = new File(appDir, "CustomFurnish.xcodeproj");
//File file = new File("/Users/cloudgust/dev/bluebox/iphone-app/CustomFurnish.xcodeproj");
capabilities.setCapability("app", app.getAbsolutePath());
wd = new IOSDriver(new URL("http://127.0.0.1:4723/wd/hub"),capabilities);
When I give the above and run the project my console shows an error 当我给出以上内容并运行项目时,控制台显示错误
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: A new session could not be created. 线程“主”中的异常org.openqa.selenium.SessionNotCreatedException:无法创建新的会话。 (Original error: Bad app: /Users/cloudgust/Documents/workspace/iosautomation/\\Users\\cloudgust\\dev\\bluebox\\iphone-app\\CustomFurnish.xcodeproj/CustomFurnish.xcodeproj. App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name. cause: Error: Using local app, but didn't end in .zip, .ipa or .app) (WARNING: The server did not provide any stacktrace information). (原始错误:错误的应用程序:/ Users / cloudgust / Documents / workspace / iosautomation / \\ Users \\ cloudgust \\ dev \\ bluebox \\ iphone-app \\ CustomFurnish.xcodeproj / CustomFurnish.xcodeproj。应用程序路径必须是绝对路径,或相对于appium服务器安装目录,压缩文件的URL或特殊的应用程序名称原因:错误:使用本地应用程序,但未以.zip,.ipa或.app结尾(警告:服务器未提供任何内容stacktrace信息)。
Basically what I'm trying to do is I have app written in xcode on a mac , I want to run it in automated tests using appium . 基本上,我想做的是在Mac上用xcode编写应用程序,我想使用appium在自动化测试中运行它。 but when im doing it I encounter with tat error. 但是当我这样做时,我遇到了tat错误。 can someone please help . 有人可以帮忙吗?
TIA, Sampath TIA,Sampath
This might be because the path of the ios app you provided in File appDir doesn't end with .app or .ipa extension. 这可能是因为您在File appDir中提供的ios应用程序的路径未以.app或.ipa扩展名结尾。 It must contain the path up to the application code with extension .ipa or .app. 它必须包含扩展名为.ipa或.app的应用程序代码的路径。
You must build the project and generate a .app file, then point appium to that path. 您必须构建项目并生成一个.app文件,然后将appium指向该路径。
To build on command line you can use xcodebuild 要在命令行上构建,您可以使用xcodebuild
Here are some example of command like arguments and such: Apple xcodebuild 以下是一些类似参数的命令示例: Apple xcodebuild
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.