UWP UI自動化測試(一)------WinAppDriver/Inspect.exe demo


1、首先在啟動 WinAppDriver.exe,運行界面:

  路徑:C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe

如果不運行它的話,UI自動化工程在運行單元測試的時候,vs 會拋異常:

1
2
3
4
5
6
7
8
/* 先啟動 C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe,否則會拋異常
   Unexpected error. System.Net.WebException: 無法連接到遠程服務器 ---> System.Net.Sockets.SocketException: 由於目標計算機積極拒絕,無法連接。 127.0.0.1:4723
   在 System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   在 System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
   --- 內部異常堆棧跟蹤的結尾 ---
   在 OpenQA.Selenium.Appium.Service.AppiumCommandExecutor.Execute(Command commandToExecute)
   在 OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
*/

 

2、使用 inspect.exe 工具,確定軟件運行時,需要觸發事件 UI元素的 ID/Name 

  路徑:C:\Program Files (x86)\Windows Kits\10\bin\x64\inspect.exe

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM