Open Xiphereal opened 2 years ago
Can you share the code?
Sure, here is a stripped version, keeping just the relevant parts.
AppiumWindowsDriver, our wrapper for the Appium Windows driver, using WinAppDriver:
using System;
using System.IO;
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Appium.Service;
using OpenQA.Selenium.Appium.Windows;
namespace UiTests
{
public class AppiumWindowsDriver
{
private const string AppiumServerBinaryPath = @"C:\Program Files\Appium\resources\app\node_modules\appium\build\lib\main.js";
private const string AppiumServerIP = "127.0.0.1";
private const int AppiumServerPort = 4723;
private static readonly string AppiumServerURL = $"http://{AppiumServerIP}:{AppiumServerPort}/wd/hub";
private static readonly string AppiumServerLogPath = Environment.CurrentDirectory + @"\AppiumServerLog.txt";
private bool alreadyOpen;
private AppiumLocalService appiumLocalService;
private WindowsDriver<WindowsElement> applicationDriver;
public AppiumWindowsDriver()
{
this.StartAppiumLocalService();
this.InitializeApplicationDriver();
}
private void StartAppiumLocalService()
{
this.appiumLocalService = new AppiumServiceBuilder()
.WithAppiumJS(new FileInfo(AppiumServerBinaryPath))
.WithIPAddress(AppiumServerIP).UsingPort(AppiumServerPort)
.WithLogFile(new FileInfo(AppiumServerLogPath))
.Build();
this.appiumLocalService.Start();
}
private void InitializeApplicationDriver()
{
AppiumOptions appiumOptions = BuildAppiumOptionsForApplicationDriver();
this.applicationDriver = new WindowsDriver<WindowsElement>(new Uri(AppiumServerURL), appiumOptions);
this.applicationDriver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(30);
this.alreadyOpen = true;
}
private static AppiumOptions BuildAppiumOptionsForApplicationDriver()
{
AppiumOptions appiumOptions = new AppiumOptions();
appiumOptions.AddAdditionalCapability("appium:app", "Path/To/Our/App");
appiumOptions.AddAdditionalCapability("appium:deviceName", "WindowsPC");
const int WaitForAppLauchInSeconds = 30;
appiumOptions.AddAdditionalCapability("ms:waitForAppLaunch", WaitForAppLauchInSeconds);
return appiumOptions;
}
public void CommandAppExit()
{
this.applicationDriver.CloseApp();
this.alreadyOpen = false;
}
public void ClickDialogButtonForNegativeOption()
{
WindowsElement discardUnsavedChangesButton = this.applicationDriver.FindElementByAccessibilityId("PART_NoButton1");
discardUnsavedChangesButton.Click();
}
public void PutFocusOnApp()
{
WindowsElement documentPane = this.applicationDriver.FindElementByAccessibilityId("paneRichEdit");
documentPane.Click();
}
public void OpenApplication()
{
if (this.alreadyOpen)
return;
this.applicationDriver.LaunchApp();
this.alreadyOpen = true;
}
}
}
Here is the relevant bit from the test:
AppiumWindowsDriver driver = new AppiumWindowsDriver();
for (int i = 0; i < 3; i++)
{
driver.OpenApplication();
driver.PutFocusOnApp();
driver.CommandAppExit();
driver.ClickDialogButtonForNegativeOption();
}
Change the line this.applicationDriver.CloseApp(); to this.applicationDriver.Quit();
If try that, but the next command over the driver, fails with a System.NotImplementedException: The requested resource could not be found, or a request was received using an HTTP method that is not supported by the mapped resource
. If tried removing the driver.ClickDialogButtonForNegativeOption
, but the outcome is the same.
Here is the associated log:
2022-09-13 14:49:25:016 [Appium] Welcome to Appium v1.21.0
2022-09-13 14:49:25:018 [Appium] Non-default server args:
2022-09-13 14:49:25:019 [Appium] address: 127.0.0.1
2022-09-13 14:49:25:019 [Appium] logFile: D:\W\AL\G1\TestApps\Reports\UI\TemplatesDesigner\UiTests.PerformanceTests\bin\Debug\netcoreapp3.1\AppiumServerLog.txt
2022-09-13 14:49:25:069 [Appium] Appium REST http interface listener started on 127.0.0.1:4723
2022-09-13 14:49:25:326 [HTTP] --> GET /wd/hub/status
2022-09-13 14:49:25:328 [HTTP] {}
2022-09-13 14:49:25:330 [GENERIC] Calling AppiumDriver.getStatus() with args: []
2022-09-13 14:49:25:332 [GENERIC] Responding to client with driver.getStatus() result: {"build":{"version":"1.21.0"}}
2022-09-13 14:49:25:340 [HTTP] <-- GET /wd/hub/status 200 10 ms - 68
2022-09-13 14:49:25:340 [HTTP]
2022-09-13 14:49:25:416 [HTTP] --> POST /wd/hub/session
2022-09-13 14:49:25:416 [HTTP] {"desiredCapabilities":{"appium:app":"D:\\W\\AL\\G1\\TestApps\\Reports\\UI\\TemplatesDesigner\\PerformanceTestApp.WPF\\bin\\Release\\netcoreapp3.1\\ADDInformatica.TestApps.Reports.UI.TemplatesDesigner.PerformanceTestApp.WPF.exe","appium:deviceName":"WindowsPC","ms:waitForAppLaunch":30,"platformName":"Windows"},"capabilities":{"firstMatch":[{"appium:app":"D:\\W\\AL\\G1\\TestApps\\Reports\\UI\\TemplatesDesigner\\PerformanceTestApp.WPF\\bin\\Release\\netcoreapp3.1\\ADDInformatica.TestApps.Reports.UI.TemplatesDesigner.PerformanceTestApp.WPF.exe","appium:deviceName":"WindowsPC","ms:waitForAppLaunch":30,"platformName":"Windows"}]}}
2022-09-13 14:49:25:418 [W3C] Calling AppiumDriver.createSession() with args: [{"appium:app":"D:\\W\\AL\\G1\\TestApps\\Reports\\UI\\TemplatesDesigner\\PerformanceTestApp.WPF\\bin\\Release\\netcoreapp3.1\\ADDInformatica.TestApps.Reports.UI.TemplatesDesigner.PerformanceTestApp.WPF.exe","appium:deviceName":"WindowsPC","ms:waitForAppLaunch":30,"platformName":"Windows"},null,{"firstMatch":[{"appium:app":"D:\\W\\AL\\G1\\TestApps\\Reports\\UI\\TemplatesDesigner\\PerformanceTestApp.WPF\\bin\\Release\\netcoreapp3.1\\ADDInformatica.TestApps.Reports.UI.TemplatesDesigner.PerformanceTestApp.WPF.exe","appium:deviceName":"WindowsPC","ms:waitForAppLaunch":30,"platformName":"Windows"}]}]
2022-09-13 14:49:25:419 [BaseDriver] Event 'newSessionRequested' logged at 1663080565418 (16:49:25 GMT+0200 (hora de verano de Europa central))
2022-09-13 14:49:25:544 [Appium] Appium v1.21.0 creating new WindowsDriver (v1.18.1) session
2022-09-13 14:49:25:548 [BaseDriver] W3C capabilities and MJSONWP desired capabilities were provided
2022-09-13 14:49:25:548 [BaseDriver] Creating session with W3C capabilities: {
2022-09-13 14:49:25:549 [BaseDriver] "alwaysMatch": {
2022-09-13 14:49:25:549 [BaseDriver] "ms:waitForAppLaunch": 30,
2022-09-13 14:49:25:549 [BaseDriver] "platformName": "Windows",
2022-09-13 14:49:25:549 [BaseDriver] "appium:app": "D:\\W\\AL\\G1\\TestApps\\Reports\\UI\\TemplatesDesigner\\PerformanceTestApp.WPF\\bin\\Release\\netcoreapp3.1\\ADDInformatica.TestApps.Reports.UI.TemplatesDesigner.PerformanceTestApp.WPF.exe",
2022-09-13 14:49:25:550 [BaseDriver] "appium:deviceName": "WindowsPC"
2022-09-13 14:49:25:550 [BaseDriver] },
2022-09-13 14:49:25:550 [BaseDriver] "firstMatch": [
2022-09-13 14:49:25:551 [BaseDriver] {}
2022-09-13 14:49:25:551 [BaseDriver] ]
2022-09-13 14:49:25:551 [BaseDriver] }
2022-09-13 14:49:25:556 [BaseDriver] Session created with session id: 3843be04-9ce9-46bc-8663-8f6b9d04da64
2022-09-13 14:49:25:566 [WinAppDriver] WinAppDriver exists, but the checksum did not match. Was it replaced manually?
2022-09-13 14:49:25:574 [WinAppDriver] Spawning 'C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe' with args: ["4724/wd/hub"]
2022-09-13 14:49:25:596 [WD Proxy] Matched '/status' to command name 'getStatus'
2022-09-13 14:49:25:598 [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:4724/wd/hub/status] with no body
2022-09-13 14:49:25:616 [WD Proxy] connect ECONNREFUSED 127.0.0.1:4724
2022-09-13 14:49:25:622 [WinAppDriver] Windows Application Driver listening for requests at: http://127.0.0.1:4724/wd/hub
2022-09-13 14:49:25:624 [WinAppDriver] Press ENTER to exit.
2022-09-13 14:49:26:619 [WD Proxy] Matched '/status' to command name 'getStatus'
2022-09-13 14:49:26:620 [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:4724/wd/hub/status] with no body
2022-09-13 14:49:26:625 [WinAppDriver] ==========================================
2022-09-13 14:49:26:625 [WinAppDriver] GET /wd/hub/status HTTP/1.1
2022-09-13 14:49:26:625 [WinAppDriver] Accept: application/json, */*
2022-09-13 14:49:26:626 [WinAppDriver] Connection: keep-alive
2022-09-13 14:49:26:626 [WinAppDriver] Content-Type: application/json; charset=utf-8
2022-09-13 14:49:26:626 [WinAppDriver] Host: 127.0.0.1:4724
2022-09-13 14:49:26:626 [WinAppDriver] User-Agent: appium
2022-09-13 14:49:26:630 [WD Proxy] Got response with status 200: {"build":{"revision":"2003","time":"Wed Aug 26 07:56:06 2020","version":"1.2.2009"},"os":{"arch":"amd64","name":"windows","version":"10.0.20348"}}
2022-09-13 14:49:26:631 [WinAppDriver] Starting WinAppDriver session. Will timeout in '20000' ms.
2022-09-13 14:49:26:632 [WD Proxy] Matched '/session' to command name 'createSession'
2022-09-13 14:49:26:632 [WD Proxy] Proxying [POST /session] to [POST http://127.0.0.1:4724/wd/hub/session] with body: {"desiredCapabilities":{"ms:waitForAppLaunch":30,"platformName":"Windows","app":"D:\\W\\AL\\G1\\TestApps\\Reports\\UI\\TemplatesDesigner\\PerformanceTestApp.WPF\\bin\\Release\\netcoreapp3.1\\ADDInformatica.TestApps.Reports.UI.TemplatesDesigner.PerformanceTestApp.WPF.exe","deviceName":"WindowsPC"}}
2022-09-13 14:49:26:635 [WinAppDriver] HTTP/1.1 200 OK
2022-09-13 14:49:26:635 [WinAppDriver] Content-Length: 146
2022-09-13 14:49:26:636 [WinAppDriver] Content-Type: application/json
2022-09-13 14:49:26:636 [WinAppDriver] ==========================================
2022-09-13 14:49:26:637 [WinAppDriver] POST /wd/hub/session HTTP/1.1
2022-09-13 14:49:26:637 [WinAppDriver] Accept: application/json, */*
2022-09-13 14:49:26:637 [WinAppDriver] Connection: keep-alive
2022-09-13 14:49:26:637 [WinAppDriver] Content-Length: 298
2022-09-13 14:49:26:638 [WinAppDriver] Content-Type: application/json; charset=utf-8
2022-09-13 14:49:26:638 [WinAppDriver] Host: 127.0.0.1:4724
2022-09-13 14:49:26:638 [WinAppDriver] User-Agent: appium
2022-09-13 14:49:26:639 [WinAppDriver]
2022-09-13 14:49:26:639 [WinAppDriver] {"desiredCapabilities":{"ms:waitForAppLaunch":30,"platformName":"Windows","app":"D:\\W\\AL\\G1\\TestApps\\Reports\\UI\\TemplatesDesigner\\PerformanceTestApp.WPF\\bin\\Release\\netcoreapp3.1\\ADDInformatica.TestApps.Reports.UI.TemplatesDesigner.PerformanceTestApp.WPF.exe","deviceName":"WindowsPC"}}
2022-09-13 14:50:02:256 [WD Proxy] Got response with status 200: {"sessionId":"8CEAB49C-8702-468F-AA4E-B1EABDF22ABD","status":0,"value":{"app":"D:\\W\\AL\\G1\\TestApps\\Reports\\UI\\TemplatesDesigner\\PerformanceTestApp.WPF\\bin\\Release\\netcoreapp3.1\\ADDInformatica.TestApps.Reports.UI.TemplatesDesigner.PerformanceTestApp.WPF.exe","ms:waitForAppLaunch":30,"platformName":"Windows"}}
2022-09-13 14:50:02:257 [WD Proxy] Determined the downstream protocol as 'MJSONWP'
2022-09-13 14:50:02:258 [Appium] New WindowsDriver session created successfully, session 3843be04-9ce9-46bc-8663-8f6b9d04da64 added to master session list
2022-09-13 14:50:02:259 [WinAppDriver] HTTP/1.1 200 OK
2022-09-13 14:50:02:259 [WinAppDriver] Content-Length: 321
2022-09-13 14:50:02:259 [WinAppDriver] Content-Type: application/json
2022-09-13 14:50:02:259 [WinAppDriver]
2022-09-13 14:50:02:260 [WinAppDriver] {"sessionId":"8CEAB49C-8702-468F-AA4E-B1EABDF22ABD","status":0,"value":{"app":"D:\\W\\AL\\G1\\TestApps\\Reports\\UI\\TemplatesDesigner\\PerformanceTestApp.WPF\\bin\\Release\\netcoreapp3.1\\ADDInformatica.TestApps.Reports.UI.TemplatesDesigner.PerformanceTestApp.WPF.exe","ms:waitForAppLaunch":30,"platformName":"Windows"}}
2022-09-13 14:50:02:261 [BaseDriver] Event 'newSessionStarted' logged at 1663080602261 (16:50:02 GMT+0200 (hora de verano de Europa central))
2022-09-13 14:50:02:262 [W3C (3843be04)] Cached the protocol value 'W3C' for the new session 3843be04-9ce9-46bc-8663-8f6b9d04da64
2022-09-13 14:50:02:262 [W3C (3843be04)] Responding to client with driver.createSession() result: {"capabilities":{"ms:waitForAppLaunch":30,"platformName":"Windows","app":"D:\\W\\AL\\G1\\TestApps\\Reports\\UI\\TemplatesDesigner\\PerformanceTestApp.WPF\\bin\\Release\\netcoreapp3.1\\ADDInformatica.TestApps.Reports.UI.TemplatesDesigner.PerformanceTestApp.WPF.exe","deviceName":"WindowsPC"}}
2022-09-13 14:50:02:264 [HTTP] <-- POST /wd/hub/session 200 36848 ms - 352
2022-09-13 14:50:02:264 [HTTP]
2022-09-13 14:50:02:284 [HTTP] --> POST /wd/hub/session/3843be04-9ce9-46bc-8663-8f6b9d04da64/timeouts
2022-09-13 14:50:02:285 [HTTP] {"implicit":30000}
2022-09-13 14:50:02:287 [W3C (3843be04)] Driver proxy active, passing request on via HTTP proxy
2022-09-13 14:50:02:289 [WD Proxy] Matched '/wd/hub/session/3843be04-9ce9-46bc-8663-8f6b9d04da64/timeouts' to command name 'timeouts'
2022-09-13 14:50:02:290 [Protocol Converter] Will send the following request bodies to /timeouts: [{"type":"implicit","ms":30000}]
2022-09-13 14:50:02:291 [WD Proxy] Proxying [POST /wd/hub/session/3843be04-9ce9-46bc-8663-8f6b9d04da64/timeouts] to [POST http://127.0.0.1:4724/wd/hub/session/8CEAB49C-8702-468F-AA4E-B1EABDF22ABD/timeouts] with body: {"type":"implicit","ms":30000}
2022-09-13 14:50:02:294 [WinAppDriver] ==========================================
2022-09-13 14:50:02:294 [WinAppDriver] POST /wd/hub/session/8CEAB49C-8702-468F-AA4E-B1EABDF22ABD/timeouts HTTP/1.1
2022-09-13 14:50:02:295 [WinAppDriver] Accept: application/json, */*
2022-09-13 14:50:02:295 [WinAppDriver] Connection: keep-alive
2022-09-13 14:50:02:295 [WinAppDriver] Content-Length: 30
2022-09-13 14:50:02:295 [WinAppDriver] Content-Type: application/json; charset=utf-8
2022-09-13 14:50:02:296 [WinAppDriver] Host: 127.0.0.1:4724
2022-09-13 14:50:02:296 [WinAppDriver] User-Agent: appium
2022-09-13 14:50:02:296 [WinAppDriver]
2022-09-13 14:50:02:297 [WinAppDriver] {"type":"implicit","ms":30000}
2022-09-13 14:50:02:298 [WD Proxy] Got response with status 200: {"sessionId":"8CEAB49C-8702-468F-AA4E-B1EABDF22ABD","status":0}
2022-09-13 14:50:02:299 [WD Proxy] Replacing sessionId 8CEAB49C-8702-468F-AA4E-B1EABDF22ABD with 3843be04-9ce9-46bc-8663-8f6b9d04da64
2022-09-13 14:50:02:301 [HTTP] <-- POST /wd/hub/session/3843be04-9ce9-46bc-8663-8f6b9d04da64/timeouts 200 16 ms - 65
2022-09-13 14:50:02:301 [HTTP]
2022-09-13 14:50:02:301 [WinAppDriver] HTTP/1.1 200 OK
2022-09-13 14:50:02:302 [WinAppDriver] Content-Length: 63
2022-09-13 14:50:02:302 [WinAppDriver] Content-Type: application/json
2022-09-13 14:50:02:302 [WinAppDriver]
2022-09-13 14:50:02:303 [WinAppDriver] {"sessionId":"8CEAB49C-8702-468F-AA4E-B1EABDF22ABD","status":0}
2022-09-13 14:50:02:306 [HTTP] --> POST /wd/hub/session/3843be04-9ce9-46bc-8663-8f6b9d04da64/element
2022-09-13 14:50:02:307 [HTTP] {"using":"accessibility id","value":"paneRichEdit"}
2022-09-13 14:50:02:310 [W3C (3843be04)] Calling AppiumDriver.findElement() with args: ["accessibility id","paneRichEdit","3843be04-9ce9-46bc-8663-8f6b9d04da64"]
2022-09-13 14:50:02:311 [BaseDriver] Valid locator strategies for this request: xpath, id, name, class name, accessibility id
2022-09-13 14:50:02:317 [WD Proxy] Matched '/element' to command name 'findElement'
2022-09-13 14:50:02:318 [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:4724/wd/hub/session/8CEAB49C-8702-468F-AA4E-B1EABDF22ABD/element] with body: {"using":"accessibility id","value":"paneRichEdit"}
2022-09-13 14:50:02:321 [WinAppDriver] ==========================================
2022-09-13 14:50:02:321 [WinAppDriver] POST /wd/hub/session/8CEAB49C-8702-468F-AA4E-B1EABDF22ABD/element HTTP/1.1
2022-09-13 14:50:02:321 [WinAppDriver] Accept: application/json, */*
2022-09-13 14:50:02:322 [WinAppDriver] Connection: keep-alive
2022-09-13 14:50:02:322 [WinAppDriver] Content-Length: 51
2022-09-13 14:50:02:322 [WinAppDriver] Content-Type: application/json; charset=utf-8
2022-09-13 14:50:02:323 [WinAppDriver] Host: 127.0.0.1:4724
2022-09-13 14:50:02:323 [WinAppDriver] User-Agent: appium
2022-09-13 14:50:02:324 [WinAppDriver]
2022-09-13 14:50:02:324 [WinAppDriver] {"using":"accessibility id","value":"paneRichEdit"}
2022-09-13 14:50:03:613 [WinAppDriver] HTTP/1.1 200 OK
2022-09-13 14:50:03:613 [WinAppDriver] Content-Length: 102
2022-09-13 14:50:03:613 [WinAppDriver] Content-Type: application/json
2022-09-13 14:50:03:613 [WinAppDriver]
2022-09-13 14:50:03:613 [WinAppDriver] {"sessionId":"8CEAB49C-8702-468F-AA4E-B1EABDF22ABD","status":0,"value":{"ELEMENT":"7.24156.41029017"}}
2022-09-13 14:50:03:613 [WD Proxy] Got response with status 200: {"sessionId":"8CEAB49C-8702-468F-AA4E-B1EABDF22ABD","status":0,"value":{"ELEMENT":"7.24156.41029017"}}
2022-09-13 14:50:03:617 [W3C (3843be04)] Responding to client with driver.findElement() result: {"element-6066-11e4-a52e-4f735466cecf":"7.24156.41029017","ELEMENT":"7.24156.41029017"}
2022-09-13 14:50:03:618 [HTTP] <-- POST /wd/hub/session/3843be04-9ce9-46bc-8663-8f6b9d04da64/element 200 1311 ms - 97
2022-09-13 14:50:03:619 [HTTP]
2022-09-13 14:50:03:626 [HTTP] --> POST /wd/hub/session/3843be04-9ce9-46bc-8663-8f6b9d04da64/element/7.24156.41029017/click
2022-09-13 14:50:03:627 [HTTP] {}
2022-09-13 14:50:03:631 [W3C (3843be04)] Driver proxy active, passing request on via HTTP proxy
2022-09-13 14:50:03:633 [WD Proxy] Matched '/wd/hub/session/3843be04-9ce9-46bc-8663-8f6b9d04da64/element/7.24156.41029017/click' to command name 'click'
2022-09-13 14:50:03:634 [WD Proxy] Proxying [POST /wd/hub/session/3843be04-9ce9-46bc-8663-8f6b9d04da64/element/7.24156.41029017/click] to [POST http://127.0.0.1:4724/wd/hub/session/8CEAB49C-8702-468F-AA4E-B1EABDF22ABD/element/7.24156.41029017/click] with body: {}
2022-09-13 14:50:03:636 [WinAppDriver] ==========================================
2022-09-13 14:50:03:636 [WinAppDriver] POST /wd/hub/session/8CEAB49C-8702-468F-AA4E-B1EABDF22ABD/element/7.24156.41029017/click HTTP/1.1
2022-09-13 14:50:03:637 [WinAppDriver] Accept: application/json, */*
2022-09-13 14:50:03:637 [WinAppDriver] Connection: keep-alive
2022-09-13 14:50:03:637 [WinAppDriver] Content-Length: 2
2022-09-13 14:50:03:638 [WinAppDriver] Content-Type: application/json; charset=utf-8
2022-09-13 14:50:03:638 [WinAppDriver] Host: 127.0.0.1:4724
2022-09-13 14:50:03:638 [WinAppDriver] User-Agent: appium
2022-09-13 14:50:03:638 [WinAppDriver]
2022-09-13 14:50:03:639 [WinAppDriver] {}
2022-09-13 14:50:03:974 [WinAppDriver] HTTP/1.1 200 OK
2022-09-13 14:50:03:974 [WinAppDriver] Content-Length: 63
2022-09-13 14:50:03:974 [WinAppDriver] Content-Type: application/json
2022-09-13 14:50:03:974 [WinAppDriver]
2022-09-13 14:50:03:975 [WinAppDriver] {"sessionId":"8CEAB49C-8702-468F-AA4E-B1EABDF22ABD","status":0}
2022-09-13 14:50:03:976 [WD Proxy] Got response with status 200: {"sessionId":"8CEAB49C-8702-468F-AA4E-B1EABDF22ABD","status":0}
2022-09-13 14:50:03:977 [WD Proxy] Replacing sessionId 8CEAB49C-8702-468F-AA4E-B1EABDF22ABD with 3843be04-9ce9-46bc-8663-8f6b9d04da64
2022-09-13 14:50:03:979 [HTTP] <-- POST /wd/hub/session/3843be04-9ce9-46bc-8663-8f6b9d04da64/element/7.24156.41029017/click 200 351 ms - 65
2022-09-13 14:50:03:980 [HTTP]
2022-09-13 14:50:03:983 [HTTP] --> POST /wd/hub/session/3843be04-9ce9-46bc-8663-8f6b9d04da64/element
2022-09-13 14:50:03:984 [HTTP] {"using":"accessibility id","value":"paneRichEdit"}
2022-09-13 14:50:03:985 [W3C (3843be04)] Calling AppiumDriver.findElement() with args: ["accessibility id","paneRichEdit","3843be04-9ce9-46bc-8663-8f6b9d04da64"]
2022-09-13 14:50:03:985 [BaseDriver] Valid locator strategies for this request: xpath, id, name, class name, accessibility id
2022-09-13 14:50:03:986 [WD Proxy] Matched '/element' to command name 'findElement'
2022-09-13 14:50:03:987 [WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:4724/wd/hub/session/8CEAB49C-8702-468F-AA4E-B1EABDF22ABD/element] with body: {"using":"accessibility id","value":"paneRichEdit"}
2022-09-13 14:50:03:989 [WinAppDriver] ==========================================
2022-09-13 14:50:03:990 [WinAppDriver] POST /wd/hub/session/8CEAB49C-8702-468F-AA4E-B1EABDF22ABD/element HTTP/1.1
2022-09-13 14:50:03:990 [WinAppDriver] Accept: application/json, */*
2022-09-13 14:50:03:990 [WinAppDriver] Connection: keep-alive
2022-09-13 14:50:03:991 [WinAppDriver] Content-Length: 51
2022-09-13 14:50:03:991 [WinAppDriver] Content-Type: application/json; charset=utf-8
2022-09-13 14:50:03:991 [WinAppDriver] Host: 127.0.0.1:4724
2022-09-13 14:50:03:991 [WinAppDriver] User-Agent: appium
2022-09-13 14:50:03:992 [WinAppDriver]
2022-09-13 14:50:03:992 [WinAppDriver] {"using":"accessibility id","value":"paneRichEdit"}
2022-09-13 14:50:05:037 [WinAppDriver] HTTP/1.1 200 OK
2022-09-13 14:50:05:037 [WinAppDriver] Content-Length: 102
2022-09-13 14:50:05:037 [WinAppDriver] Content-Type: application/json
2022-09-13 14:50:05:038 [WinAppDriver]
2022-09-13 14:50:05:038 [WinAppDriver] {"sessionId":"8CEAB49C-8702-468F-AA4E-B1EABDF22ABD","status":0,"value":{"ELEMENT":"7.24156.41029017"}}
2022-09-13 14:50:05:039 [WD Proxy] Got response with status 200: {"sessionId":"8CEAB49C-8702-468F-AA4E-B1EABDF22ABD","status":0,"value":{"ELEMENT":"7.24156.41029017"}}
2022-09-13 14:50:05:040 [W3C (3843be04)] Responding to client with driver.findElement() result: {"element-6066-11e4-a52e-4f735466cecf":"7.24156.41029017","ELEMENT":"7.24156.41029017"}
2022-09-13 14:50:05:042 [HTTP] <-- POST /wd/hub/session/3843be04-9ce9-46bc-8663-8f6b9d04da64/element 200 1058 ms - 97
2022-09-13 14:50:05:042 [HTTP]
2022-09-13 14:50:05:051 [HTTP] --> POST /wd/hub/session/3843be04-9ce9-46bc-8663-8f6b9d04da64/element/7.24156.41029017/value
2022-09-13 14:50:05:052 [HTTP] {"text":"","value":[""]}
2022-09-13 14:50:05:054 [W3C (3843be04)] Driver proxy active, passing request on via HTTP proxy
2022-09-13 14:50:05:055 [WD Proxy] Matched '/wd/hub/session/3843be04-9ce9-46bc-8663-8f6b9d04da64/element/7.24156.41029017/value' to command name 'setValue'
2022-09-13 14:50:05:056 [WD Proxy] Proxying [POST /wd/hub/session/3843be04-9ce9-46bc-8663-8f6b9d04da64/element/7.24156.41029017/value] to [POST http://127.0.0.1:4724/wd/hub/session/8CEAB49C-8702-468F-AA4E-B1EABDF22ABD/element/7.24156.41029017/value] with body: {"text":"","value":[""]}
2022-09-13 14:50:05:059 [WinAppDriver] ==========================================
2022-09-13 14:50:05:060 [WinAppDriver] POST /wd/hub/session/8CEAB49C-8702-468F-AA4E-B1EABDF22ABD/element/7.24156.41029017/value HTTP/1.1
2022-09-13 14:50:05:060 [WinAppDriver] Accept: application/json, */*
2022-09-13 14:50:05:061 [WinAppDriver] Connection: keep-alive
2022-09-13 14:50:05:061 [WinAppDriver] Content-Length: 30
2022-09-13 14:50:05:062 [WinAppDriver] Content-Type: application/json; charset=utf-8
2022-09-13 14:50:05:063 [WinAppDriver] Host: 127.0.0.1:4724
2022-09-13 14:50:05:064 [WinAppDriver] User-Agent: appium
2022-09-13 14:50:05:066 [WinAppDriver]
2022-09-13 14:50:05:066 [WinAppDriver] {"text":"","value":[""]}
2022-09-13 14:50:05:244 [WinAppDriver] HTTP/1.1 200 OK
2022-09-13 14:50:05:244 [WinAppDriver] Content-Length: 63
2022-09-13 14:50:05:245 [WinAppDriver] Content-Type: application/json
2022-09-13 14:50:05:245 [WinAppDriver]
2022-09-13 14:50:05:246 [WinAppDriver] {"sessionId":"8CEAB49C-8702-468F-AA4E-B1EABDF22ABD","status":0}
2022-09-13 14:50:05:247 [WD Proxy] Got response with status 200: {"sessionId":"8CEAB49C-8702-468F-AA4E-B1EABDF22ABD","status":0}
2022-09-13 14:50:05:247 [WD Proxy] Replacing sessionId 8CEAB49C-8702-468F-AA4E-B1EABDF22ABD with 3843be04-9ce9-46bc-8663-8f6b9d04da64
2022-09-13 14:50:05:249 [HTTP] <-- POST /wd/hub/session/3843be04-9ce9-46bc-8663-8f6b9d04da64/element/7.24156.41029017/value 200 197 ms - 65
2022-09-13 14:50:05:249 [HTTP]
2022-09-13 14:50:05:252 [HTTP] --> DELETE /wd/hub/session/3843be04-9ce9-46bc-8663-8f6b9d04da64
2022-09-13 14:50:05:252 [HTTP] {}
2022-09-13 14:50:05:253 [W3C (3843be04)] Calling AppiumDriver.deleteSession() with args: ["3843be04-9ce9-46bc-8663-8f6b9d04da64"]
2022-09-13 14:50:05:253 [BaseDriver] Event 'quitSessionRequested' logged at 1663080605253 (16:50:05 GMT+0200 (hora de verano de Europa central))
2022-09-13 14:50:05:254 [Appium] Removing session 3843be04-9ce9-46bc-8663-8f6b9d04da64 from our master session list
2022-09-13 14:50:05:255 [WinAppDriver] Deleting WinAppDriver session
2022-09-13 14:50:05:256 [WinAppDriver] Deleting WinAppDriver server session
2022-09-13 14:50:05:256 [WD Proxy] Matched '/session/8CEAB49C-8702-468F-AA4E-B1EABDF22ABD' to command name 'deleteSession'
2022-09-13 14:50:05:257 [WD Proxy] Proxying [DELETE /session/8CEAB49C-8702-468F-AA4E-B1EABDF22ABD] to [DELETE http://127.0.0.1:4724/wd/hub/session/8CEAB49C-8702-468F-AA4E-B1EABDF22ABD] with no body
2022-09-13 14:50:05:259 [WinAppDriver] ==========================================
2022-09-13 14:50:05:259 [WinAppDriver] DELETE /wd/hub/session/8CEAB49C-8702-468F-AA4E-B1EABDF22ABD HTTP/1.1
2022-09-13 14:50:05:259 [WinAppDriver] Accept: application/json, */*
2022-09-13 14:50:05:260 [WinAppDriver] Connection: keep-alive
2022-09-13 14:50:05:260 [WinAppDriver] Content-Type: application/json; charset=utf-8
2022-09-13 14:50:05:260 [WinAppDriver] Host: 127.0.0.1:4724
2022-09-13 14:50:05:261 [WinAppDriver] User-Agent: appium
2022-09-13 14:50:11:636 [WinAppDriver] HTTP/1.1 200 OK
2022-09-13 14:50:11:636 [WinAppDriver] Content-Length: 12
2022-09-13 14:50:11:637 [WinAppDriver] Content-Type: application/json
2022-09-13 14:50:11:637 [WinAppDriver]
2022-09-13 14:50:11:637 [WinAppDriver] {"status":0}
2022-09-13 14:50:11:639 [WD Proxy] Got response with status 200: {"status":0}
2022-09-13 14:50:11:665 [WinAppDriver] WinAppDriver exited with code null, signal SIGTERM
2022-09-13 14:50:11:667 [BaseDriver] Event 'quitSessionFinished' logged at 1663080611667 (16:50:11 GMT+0200 (hora de verano de Europa central))
2022-09-13 14:50:11:668 [W3C (3843be04)] Received response: null
2022-09-13 14:50:11:668 [W3C (3843be04)] But deleting session, so not returning
2022-09-13 14:50:11:668 [W3C (3843be04)] Responding to client with driver.deleteSession() result: null
2022-09-13 14:50:11:670 [HTTP] <-- DELETE /wd/hub/session/3843be04-9ce9-46bc-8663-8f6b9d04da64 200 6417 ms - 14
2022-09-13 14:50:11:670 [HTTP]
2022-09-13 14:50:11:675 [HTTP] --> POST /wd/hub/session//appium/app/launch
2022-09-13 14:50:11:676 [HTTP] {}
2022-09-13 14:50:11:688 [HTTP] No route found for /wd/hub/session//appium/app/launch
2022-09-13 14:50:11:690 [HTTP] <-- POST /wd/hub/session//appium/app/launch 404 14 ms - 211
2022-09-13 14:50:11:690 [HTTP]
the appium logs are ok, issue seems with you code.
In which part, exactly?
Hi,
We're using WinAppDriver through Appium for performance testing. The scenario is opening the app under test 3 times, and calculating the average startup time. After closing the app and try to launch it again, the app opens, but the test fails due to a 500 unknown error from WinAppDriver.
Here is the log:
Appium version: 1.21.0 WinAppDriver: 1.2.1
Is there any way of further inspecting this "unknown error"?
Thanks in advance.