使用 WinAppDriver

问题描述

我正在尝试使用“WinAppDriver”(appium + C# + Visual Studio自动化 Windows 应用程序安装过程(从 exe 文件安装,以“TeamViewer_Setup_x64.exe”为例) 下面的代码

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Appium.Windows;

namespace draftCC
{
    class Program
    {
        static void Main(string[] args)
        {
            WindowsDriver<WindowsElement> appSession;
            AppiumOptions desiredCapabilties = new AppiumOptions();
            desiredCapabilties.AddAdditionalCapability("app",@"C:\\Users\\taynq\\Downloads\\TeamViewer_Setup_x64.exe");
            appSession = new WindowsDriver<WindowsElement>(new Uri("http://127.0.0.1:4723/"),desiredCapabilties);
            if(appSession != null)
            {
                Console.WriteLine("App not started");
                return;
            }

        }
    }
}

注意:执行测试时 WinAppDriver 正在运行

出现错误

{"status":13,"value":{"error":"unkNown error","message":"无法使用 appId 定位打开的应用程序窗口:C:\\Users\\taynq\\Downloads\ \TeamViewer_Setup_x64.exe 和 processId: 7640"}}

我只是屏幕截图此链接上的错误https://i.imgur.com/N10ZcRe.png

谁能知道如何解决这个问题,谢谢!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...