找不到按钮启动Safari浏览器。确保您的appium使用使用最新版本的SafariLauncher [英] Could not find button to launch Safari. Make sure you are using the latest version of SafariLauncher that appium is using

查看:476
本文介绍了找不到按钮启动Safari浏览器。确保您的appium使用使用最新版本的SafariLauncher的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Appium推出Google.com在iOS设备(iPhone 6Plus)Safari浏览器。
这code运行正常,当我在模拟器上运行,并能打开Goog​​le.com上的Safari浏览器,但是当同样的code对设备运行,得到如下遇到错误

I am using Appium to launch Google.com on safari browser in iOS device(iPhone 6Plus). This code is running fine when I am running it on simulator and able to open Google.com on safari browser but when same code runs on device , below error is getting encountered

新的会话无法建立。 (原来的错误:错误找不到按钮启动Safari浏览器确保您使用SafariLauncher的最新版本appium使用。)(警告:
服务器没有提供任何堆栈跟踪信息)。

我用下面的软件 -

I am using below software--


  • Appium:1.4.13

  • MAC:OSX约塞米蒂10.10.5

  • 有关Eclispe:火星(4.5.0)

  • X code:7.2

  • 设备:iPhone 6加

下面是code

public class Josef {

WebDriver wd;  

 @BeforeTest  
 public void beforeTest() throws MalformedURLException { 
  DesiredCapabilities capabilities = new DesiredCapabilities();  
  capabilities.setCapability("deviceName", "DEVICE_NAME");  
  capabilities.setCapability("udid", "DEVICE_UDID");
  capabilities.setCapability("platformName", "iOS");  
  capabilities.setCapability("platformVersion", "9.0");  
  capabilities.setCapability("autoAcceptAlerts", true); 
  capabilities.setCapability("app", "com.test.safarilauncher");
  capabilities.setCapability(CapabilityType.BROWSER_NAME, "safari");  
  wd = new IOSDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);//instantiate driver  
  wd.manage().timeouts().implicitlyWait( 30,TimeUnit.SECONDS);  
 }  

 @Test  
 public void testSearchPage() throws InterruptedException {  
  wd.get("https://www.google.co.in");  
  WebElement serachField = wd.findElement(By.name("q"));  
  serachField.sendKeys("youtube");  
  serachField.sendKeys(Keys.ENTER);  
  System.out.println(wd.getCurrentUrl());  
 }  

 @AfterTest  
 public void afterTest() {  
  //wd.close();  
 } }

我也更改设备下完成的。

I have also done below changes to device


  • 已启用该设置 - >高级 - > Web检查

  • 已启用的开发技术> UI自动化

和我还安装了ios_webkit_debug_proxy和
   运行命令ios_webkit_debug_proxy -d设备的UDID:27753连接设备

And I also Installed the ios_webkit_debug_proxy and Running command to ios_webkit_debug_proxy -d Your Device's UDID:27753 to connect the device .

EDIT1

的建议由利亚姆但我不能够成功运行该命令。下面的错误,我在运行了执行。

As suggested by Liam But I am not able to run the command successfully. Below error I got while running the execution.

$ ./reset.sh --ios --real野生动物园
*确定平台
*平台是MAC
----复位/初始化Appium ----
RESETTING NPM
*安装新的或更新NPM模块(包括devDeps)
RESETTING一般
*无事可做,不是混帐回购协议
RESETTING IOS

$ ./reset.sh --ios --real-safari * Determining platform * Platform is mac ---- Resetting / Initializing Appium ---- RESETTING NPM * Installing new or updated NPM modules (including devDeps) RESETTING GENERAL * Nothing to do, not a git repo RESETTING IOS

警告:你似乎没有iOS7 / 8 SDK主动

WARNING: you do not appear to have iOS7/8 SDK active

设置的iOS config来Appium的版本
----故障:reset.sh退出,状态1 ----
----与--verbose重试一次看看错误----

Setting iOS config to Appium's version ---- FAILURE: reset.sh exited with status 1 ---- ---- Retry with --verbose to see errors ----

推荐答案

我遇到了这个问题。我的方法来解决它是手动部署SafariLauncher。

I encountered this problem. My method to get around it was to manually deploy SafariLauncher.


  • git的克隆https://github.com/budhash/SafariLauncher

  • 然后在X code和code-签名打开它。

  • 然后将其部署到设备中。

  • 运行 build.sh 在SafariLauncher项目。

  • 然后移动SafariLauncher.zip成appium /编译/ SafariLauncher,等。无论这是你的机器上。

  • 然后运行 ./ reset.sh --ios --real野生动物园

  • git clone https://github.com/budhash/SafariLauncher.
  • Then open it in xcode and code-sign it.
  • Then deploy it to the device.
  • Run build.sh in the SafariLauncher project.
  • Then move SafariLauncher.zip into a appium/build/SafariLauncher, whereever that is on your machine.
  • Then run ./reset.sh --ios --real-safari.

pretty肯定这不是预期的方法,但它是我做的,我可以验证它的工作原理。

Pretty sure this is not the intended method, but it is what I did and I can verify that it works.

此外,作为econoMichael说,使用功能browserName,野生动物园而不是应用程序,safariLauncher

Also, as econoMichael said, use the capability "browserName", "safari" instead of "app", "safariLauncher".

希望这有助于

利亚姆

这篇关于找不到按钮启动Safari浏览器。确保您的appium使用使用最新版本的SafariLauncher的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆