问题描述
我正在尝试使用“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 (将#修改为@)