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

查看:1056
本文介绍了获取错误"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天全站免登陆