获取错误“xargs"未被识别为内部或外部命令.通过 Windows 为 iOS 运行 appium 测试时 [英] Getting error 'xargs' is not recognized as an internal or external command. While running appium test for iOS through Windows

查看:103
本文介绍了获取错误“xargs"未被识别为内部或外部命令.通过 Windows 为 iOS 运行 appium 测试时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我为以下代码运行 Appium 测试时

When I run the Appium test for the below code

using System;
using OpenQA.Selenium;
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Appium.Interfaces;
using OpenQA.Selenium.Appium.MultiTouch;
using OpenQA.Selenium.Interactions;
using OpenQA.Selenium.Remote;
using OpenQA.Selenium.Appium.Android;
using OpenQA.Selenium.Appium.iOS;
using NUnit.Framework;

namespace Hof.Mobile.Tests.UIAutomation
{

    [TestFixture()]
    public class TestAppium
    {
        public static IWebDriver driver = null;

        [TestFixtureSetUp]
        public void SetUp()
        {
            DesiredCapabilities capabilities = new DesiredCapabilities();

            capabilities.SetCapability("browserName", "Safari");
            capabilities.SetCapability("deviceName", "iOS");
            capabilities.SetCapability("platformName", "ios");
            capabilities.SetCapability("udid", "<<my udid >>");

             driver = new RemoteWebDriver(new Uri("http://127.0.0.1:4723/wd/hub"), capabilities, TimeSpan.FromSeconds(180));
        }  

        public void OpenHomePage()
        {
            driver.Navigate().GoToUrl("http://url");
            Console.WriteLine("Page title is : " +driver.Title);
            //Assert.IsTrue(driver.Title.Equals("test")," Sorry , the website didnt open!!");
        }

        public void AssertTitle(string title)
        {

            Assert.IsTrue(driver.Title.Equals(title),"Title doesn't match!!");
        }



        [TearDown]
        public void End()
        {
            driver.Dispose();
        }
    }
}

将 iPad 设备与 Windows 连接时,出现此错误:

On connecting my iPad device with Windows, I get this error:

System.InvalidOperationException:无法创建新会话.(原始错误:命令失败:'xargs' 未被识别为内部或外部命令、可运行的程序或批处理文件.) (33)

System.InvalidOperationException : A new session could not be created. (Original error: Command failed: 'xargs' is not recognized as an internal or external command, operable program or batch file.) (33)

当我更改相应的参数时,相同的代码在 Android 手机上完美运行,但不适用于 iOS.

The same code is running perfectly for Android phones when I change the respective parameters, but it is not working for iOS.

推荐答案

你不能在 Windows 上使用 Appium 自动化 iOS 设备,因为你需要 XCode 而 XCode 不是为 Windows 提供的,而是只为 MAC 提供的.

You cannot automate iOS devices using Appium on Windows because you need XCode and XCode does not come for Windows but only for MAC.

所以基本上,如果你想自动化 iPad 或 iPhone,你需要在 Mac 上运行 Appium.

So basically, you need to run Appium on Mac if you want to automate iPad or iPhone.

Appium 是一个很棒的工具,但它有一些限制,而且它依赖于自动化引擎.所以在这里:

Appium is great tool but it has some limitations and it depends on automation engines. So here:

  • 如果您在 Windows 上运行 Appium,您可以自动化 Android 应用程序.

  • If you run Appium on Windows, you can automate only Android apps.

如果您在 Mac 上运行 Appium,则可以自动化Android 和 iOS 应用.

If you run Appium on Mac, you can automate both Android and iOS apps.

更详细的解释可以在这篇文章 我的.在文章正文的中心部分有一个表格描述了我刚刚告诉你的内容.

A more detailed explanation can be found in this article of mine. There is a table which describes what I just told you in the central part of the article's body.

这篇关于获取错误“xargs"未被识别为内部或外部命令.通过 Windows 为 iOS 运行 appium 测试时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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