microsoft / WinAppDriver

Windows Application Driver
MIT License
3.66k stars 1.4k forks source link

Failed to locate opened application window with appId: "xxxx_MyapplicationAppID_xxxx", and processId: 1804 : at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) #1500

Open vishnuprakash9845 opened 3 years ago

vishnuprakash9845 commented 3 years ago

Automated the UWP application, followed the below steps, In my local its working fine, but in the VM the WinAppDriver is not launching and Automation getting failed with mentioned Title error

1.Started the WinAppDriver.exe in 4723 port programmatically

string winAppDriverPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86), 
@"Windows Application Driver\WinAppDriver.exe");
Process.Start(winAppDriverPath);

2.Used the below code to launch the UWP App

        protected static WindowsDriver<WindowsElement> _session;

        var appCapabilities = new AppiumOptions();
        appCapabilities.AddAdditionalCapability("app", applicationAppId);
        _session = new WindowsDriver<WindowsElement>(new Uri(CommonTestSettings.WindowsApplicationDriverUrl), appCapabilities, TimeSpan.FromSeconds(30));

In my local system its working absolutely fine, But when I configured the same in Azure Devops Pipeline winAppDriver is not getting launched as a new window instead its starting as a process in Task Manager

image

But When I manually run the WinAppDriver.exe in VM [Path: "C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe"] A new CMD window gets opened up like below one

image

I tried to add the WinAppDriver Task too but still same issue

    1-Starting WinAppDriver by WinAppDriver devops Task
    2-Using VSTest Task configured the tests to run 
    3-Stopping WinAppDriver Task

image

Not able to resolve this issue form past few months. Please let me know any work around required. Waiting for responses from winappdriver team. Thank you.

anunay1 commented 3 years ago

With the error I assume that you application has a splash screen

vishnuprakash9845 commented 3 years ago

@anunay1 any way I can handle this splash screen

anunay1 commented 3 years ago

Read Wiki

vishnuprakash9845 commented 3 years ago

@anunay1 @timheuer @DHowett @fforjan

tried to implement the solutions, its not working. following are some of the logs.

really need some help team.

WinaAppDriver task logs screenshot

image

2021-05-29T10:32:37.6112549Z ##[section]Starting: Stop - WinAppDriver 2021-05-29T10:32:37.6285260Z ============================================================================== 2021-05-29T10:32:37.6285590Z Task : WinAppDriver 2021-05-29T10:32:37.6285959Z Description : Use this extention to integrate Windows Application Driver (WinAppDriver) into your Azure Pipeline. 2021-05-29T10:32:37.6286283Z Version : 0.0.2 2021-05-29T10:32:37.6286483Z Author : Microsoft 2021-05-29T10:32:37.6286880Z Help : Checkout the WinAppDriver GitHub Repo to learn more - https://github.com/Microsoft/WinAppDriver 2021-05-29T10:32:37.6287298Z ============================================================================== 2021-05-29T10:32:39.2911464Z Attempting to close WinAppDriver on Agent 2021-05-29T10:32:49.2832025Z 2021-05-29T10:32:49.2841926Z Printing WinAppDriver Console logs: 2021-05-29T10:32:49.2845461Z 2021-05-29T10:32:49.2897836Z Windows Application Driver listening for requests at: http://127.0.0.1:4723/ 2021-05-29T10:32:49.2898452Z Press ENTER to exit. 2021-05-29T10:32:49.2900285Z 2021-05-29T10:32:49.2901633Z 2021-05-29T10:32:49.2903053Z ========================================== 2021-05-29T10:32:49.2904103Z POST /session HTTP/1.1 2021-05-29T10:32:49.2904970Z 2021-05-29T10:32:49.2906860Z Accept: application/json, image/png 2021-05-29T10:32:49.2907338Z 2021-05-29T10:32:49.2908853Z Connection: Keep-Alive 2021-05-29T10:32:49.2909363Z 2021-05-29T10:32:49.2910732Z Content-Length: 226 2021-05-29T10:32:49.2911797Z 2021-05-29T10:32:49.2915619Z Content-Type: application/json;charset=utf-8 2021-05-29T10:32:49.2916638Z 2021-05-29T10:32:49.2917879Z Host: 127.0.0.1:4723 2021-05-29T10:32:49.2918603Z 2021-05-29T10:32:49.2920086Z User-Agent: selenium/3.141.0 (.net windows) 2021-05-29T10:32:49.2921331Z 2021-05-29T10:32:49.2922399Z 2021-05-29T10:32:49.2924329Z 2021-05-29T10:32:49.2925618Z 2021-05-29T10:32:49.2926689Z 2021-05-29T10:32:49.2927742Z 2021-05-29T10:32:49.2929146Z ========================================== 2021-05-29T10:32:49.2929953Z POST /session HTTP/1.1 2021-05-29T10:32:49.2931006Z 2021-05-29T10:32:49.2932367Z Accept: application/json, image/png 2021-05-29T10:32:49.2932866Z 2021-05-29T10:32:49.2934575Z Connection: Keep-Alive 2021-05-29T10:32:49.2935421Z 2021-05-29T10:32:49.2936844Z Content-Length: 147 2021-05-29T10:32:49.2937931Z 2021-05-29T10:32:49.2939442Z Content-Type: application/json;charset=utf-8 2021-05-29T10:32:49.2940089Z 2021-05-29T10:32:49.2941583Z Host: 127.0.0.1:4723 2021-05-29T10:32:49.2942120Z 2021-05-29T10:32:49.2943812Z User-Agent: selenium/3.141.0 (.net windows) 2021-05-29T10:32:49.2944279Z 2021-05-29T10:32:49.2945576Z 2021-05-29T10:32:49.2946911Z 2021-05-29T10:32:49.2949031Z {"desiredCapabilities":{"platformName":"Windows","app":"Root","deviceName":"WindowsPC"},"capabilities":{"firstMatch":[{"platformName":"Windows"}]}} 2021-05-29T10:32:49.2950155Z HTTP/1.1 200 OK 2021-05-29T10:32:49.2951441Z 2021-05-29T10:32:49.2953233Z Content-Length: 111 2021-05-29T10:32:49.2954632Z 2021-05-29T10:32:49.2956624Z Content-Type: application/json 2021-05-29T10:32:49.2957267Z 2021-05-29T10:32:49.2958578Z 2021-05-29T10:32:49.2959559Z 2021-05-29T10:32:49.2961307Z {"sessionId":"E7016455-A206-4C32-B30D-3B58FA8E67D7","status":0,"value":{"app":"Root","platformName":"Windows"}} 2021-05-29T10:32:49.2962324Z 2021-05-29T10:32:49.2963774Z 2021-05-29T10:32:49.2965169Z ========================================== 2021-05-29T10:32:49.2966401Z POST /session/E7016455-A206-4C32-B30D-3B58FA8E67D7/elements HTTP/1.1 2021-05-29T10:32:49.2967072Z 2021-05-29T10:32:49.2968679Z Accept: application/json, image/png 2021-05-29T10:32:49.2969443Z 2021-05-29T10:32:49.2970972Z Content-Length: 55 2021-05-29T10:32:49.2971979Z 2021-05-29T10:32:49.2973452Z Content-Type: application/json;charset=utf-8 2021-05-29T10:32:49.2974247Z 2021-05-29T10:32:49.2975507Z Host: 127.0.0.1:4723 2021-05-29T10:32:49.2976354Z 2021-05-29T10:32:49.2977683Z User-Agent: selenium/3.141.0 (.net windows) 2021-05-29T10:32:49.2980563Z 2021-05-29T10:32:49.2980659Z 2021-05-29T10:32:49.2981011Z 2021-05-29T10:32:49.2982715Z {"using":"class name","value":"ApplicationFrameWindow"} 2021-05-29T10:32:49.2983706Z HTTP/1.1 200 OK 2021-05-29T10:32:49.2984622Z 2021-05-29T10:32:49.2985885Z Content-Length: 74 2021-05-29T10:32:49.2986734Z 2021-05-29T10:32:49.2988016Z Content-Type: application/json 2021-05-29T10:32:49.2988812Z 2021-05-29T10:32:49.2989865Z 2021-05-29T10:32:49.2990903Z 2021-05-29T10:32:49.2992299Z {"sessionId":"E7016455-A206-4C32-B30D-3B58FA8E67D7","status":0,"value":[]} 2021-05-29T10:32:49.2993076Z 2021-05-29T10:32:49.2994118Z 2021-05-29T10:32:49.2995404Z ========================================== 2021-05-29T10:32:49.2996606Z POST /session/E7016455-A206-4C32-B30D-3B58FA8E67D7/window/current/maximize HTTP/1.1 2021-05-29T10:32:49.2997282Z 2021-05-29T10:32:49.2998626Z Accept: application/json, image/png 2021-05-29T10:32:49.2999179Z 2021-05-29T10:32:49.3000652Z Content-Length: 2 2021-05-29T10:32:49.3001794Z 2021-05-29T10:32:49.3003421Z Content-Type: application/json;charset=utf-8 2021-05-29T10:32:49.3004199Z 2021-05-29T10:32:49.3005754Z Host: 127.0.0.1:4723 2021-05-29T10:32:49.3006611Z 2021-05-29T10:32:49.3007932Z User-Agent: selenium/3.141.0 (.net windows) 2021-05-29T10:32:49.3008772Z 2021-05-29T10:32:49.3009816Z 2021-05-29T10:32:49.3010833Z 2021-05-29T10:32:49.3012090Z {} 2021-05-29T10:32:49.3013166Z HTTP/1.1 500 Internal Error 2021-05-29T10:32:49.3014703Z 2021-05-29T10:32:49.3017484Z Content-Length: 165 2021-05-29T10:32:49.3018458Z 2021-05-29T10:32:49.3020135Z Content-Type: application/json 2021-05-29T10:32:49.3021005Z 2021-05-29T10:32:49.3022081Z 2021-05-29T10:32:49.3023132Z 2021-05-29T10:32:49.3024693Z {"status":104,"value":{"error":"unsupported operation","message":"Indicates that a command that should have executed properly cannot be supported for some reason."}} 2021-05-29T10:32:49.3025226Z 2021-05-29T10:32:49.3026342Z 2021-05-29T10:32:49.3027869Z ========================================== 2021-05-29T10:32:49.3029305Z POST /session HTTP/1.1 2021-05-29T10:32:49.3030522Z 2021-05-29T10:32:49.3031980Z Accept: application/json, image/png 2021-05-29T10:32:49.3032884Z 2021-05-29T10:32:49.3034185Z Connection: Keep-Alive 2021-05-29T10:32:49.3035006Z 2021-05-29T10:32:49.3036295Z Content-Length: 226 2021-05-29T10:32:49.3037156Z 2021-05-29T10:32:49.3038501Z Content-Type: application/json;charset=utf-8 2021-05-29T10:32:49.3039323Z 2021-05-29T10:32:49.3040607Z Host: 127.0.0.1:4723 2021-05-29T10:32:49.3041469Z 2021-05-29T10:32:49.3042748Z User-Agent: selenium/3.141.0 (.net windows) 2021-05-29T10:32:49.3043564Z 2021-05-29T10:32:49.3044637Z 2021-05-29T10:32:49.3045648Z 2021-05-29T10:32:49.3046702Z 2021-05-29T10:32:49.3047970Z HTTP/1.1 500 Internal Error 2021-05-29T10:32:49.3048590Z 2021-05-29T10:32:49.3050049Z Content-Length: 194 2021-05-29T10:32:49.3051122Z 2021-05-29T10:32:49.3052787Z Content-Type: application/json 2021-05-29T10:32:49.3053718Z 2021-05-29T10:32:49.3055007Z 2021-05-29T10:32:49.3056100Z 2021-05-29T10:32:49.3057819Z {"status":13,"value":{"error":"unknown error","message":"Failed to locate opened application window with appId: Company.Digi_78aqb0kyn8f3w!App, and processId: 6744"}} 2021-05-29T10:32:49.3058379Z 2021-05-29T10:32:49.3059311Z 2021-05-29T10:32:49.3060647Z ========================================== 2021-05-29T10:32:49.3061692Z POST /session HTTP/1.1 2021-05-29T10:32:49.3062542Z 2021-05-29T10:32:49.3063813Z Accept: application/json, image/png 2021-05-29T10:32:49.3064656Z 2021-05-29T10:32:49.3065961Z Connection: Keep-Alive 2021-05-29T10:32:49.3066844Z 2021-05-29T10:32:49.3068135Z Content-Length: 147 2021-05-29T10:32:49.3068985Z 2021-05-29T10:32:49.3070288Z Content-Type: application/json;charset=utf-8 2021-05-29T10:32:49.3071075Z 2021-05-29T10:32:49.3072370Z Host: 127.0.0.1:4723 2021-05-29T10:32:49.3073177Z 2021-05-29T10:32:49.3074499Z User-Agent: selenium/3.141.0 (.net windows) 2021-05-29T10:32:49.3075738Z 2021-05-29T10:32:49.3076532Z 2021-05-29T10:32:49.3077731Z 2021-05-29T10:32:49.3079451Z {"desiredCapabilities":{"platformName":"Windows","app":"Root","deviceName":"WindowsPC"},"capabilities":{"firstMatch":[{"platformName":"Windows"}]}} 2021-05-29T10:32:49.3080101Z HTTP/1.1 200 OK 2021-05-29T10:32:49.3081136Z 2021-05-29T10:32:49.3082376Z Content-Length: 111 2021-05-29T10:32:49.3083405Z 2021-05-29T10:32:49.3084784Z Content-Type: application/json 2021-05-29T10:32:49.3085521Z 2021-05-29T10:32:49.3086638Z 2021-05-29T10:32:49.3087704Z 2021-05-29T10:32:49.3089188Z {"sessionId":"1FFD03E0-6D3F-43CD-B7B8-0E1C89D1BC75","status":0,"value":{"app":"Root","platformName":"Windows"}} 2021-05-29T10:32:49.3089617Z 2021-05-29T10:32:49.3090866Z 2021-05-29T10:32:49.3092276Z ========================================== 2021-05-29T10:32:49.3093172Z POST /session/1FFD03E0-6D3F-43CD-B7B8-0E1C89D1BC75/elements HTTP/1.1 2021-05-29T10:32:49.3094154Z 2021-05-29T10:32:49.3095504Z Accept: application/json, image/png 2021-05-29T10:32:49.3096294Z 2021-05-29T10:32:49.3097568Z Content-Length: 55 2021-05-29T10:32:49.3098420Z 2021-05-29T10:32:49.3099703Z Content-Type: application/json;charset=utf-8 2021-05-29T10:32:49.3100510Z 2021-05-29T10:32:49.3101780Z Host: 127.0.0.1:4723 2021-05-29T10:32:49.3102614Z 2021-05-29T10:32:49.3103966Z User-Agent: selenium/3.141.0 (.net windows) 2021-05-29T10:32:49.3104746Z 2021-05-29T10:32:49.3105762Z 2021-05-29T10:32:49.3106805Z 2021-05-29T10:32:49.3108144Z {"using":"class name","value":"ApplicationFrameWindow"} 2021-05-29T10:32:49.3109118Z HTTP/1.1 200 OK 2021-05-29T10:32:49.3109987Z 2021-05-29T10:32:49.3111861Z Content-Length: 74 2021-05-29T10:32:49.3113126Z 2021-05-29T10:32:49.3114725Z Content-Type: application/json 2021-05-29T10:32:49.3116866Z 2021-05-29T10:32:49.3118132Z 2021-05-29T10:32:49.3119288Z 2021-05-29T10:32:49.3120709Z {"sessionId":"1FFD03E0-6D3F-43CD-B7B8-0E1C89D1BC75","status":0,"value":[]} 2021-05-29T10:32:49.3121480Z 2021-05-29T10:32:49.3122500Z 2021-05-29T10:32:49.3124150Z ========================================== 2021-05-29T10:32:49.3125821Z POST /session/1FFD03E0-6D3F-43CD-B7B8-0E1C89D1BC75/window/current/maximize HTTP/1.1 2021-05-29T10:32:49.3126738Z 2021-05-29T10:32:49.3128070Z Accept: application/json, image/png 2021-05-29T10:32:49.3129239Z 2021-05-29T10:32:49.3130705Z Content-Length: 2 2021-05-29T10:32:49.3131567Z 2021-05-29T10:32:49.3132888Z Content-Type: application/json;charset=utf-8 2021-05-29T10:32:49.3133698Z 2021-05-29T10:32:49.3136570Z Host: 127.0.0.1:4723 2021-05-29T10:32:49.3136792Z 2021-05-29T10:32:49.3137273Z User-Agent: selenium/3.141.0 (.net windows) 2021-05-29T10:32:49.3138511Z 2021-05-29T10:32:49.3139582Z 2021-05-29T10:32:49.3140633Z 2021-05-29T10:32:49.3141861Z {} 2021-05-29T10:32:49.3143017Z HTTP/1.1 500 Internal Error 2021-05-29T10:32:49.3143834Z 2021-05-29T10:32:49.3145129Z Content-Length: 165 2021-05-29T10:32:49.3145931Z 2021-05-29T10:32:49.3147216Z Content-Type: application/json 2021-05-29T10:32:49.3148041Z 2021-05-29T10:32:49.3149070Z 2021-05-29T10:32:49.3150105Z 2021-05-29T10:32:49.3151660Z {"status":104,"value":{"error":"unsupported operation","message":"Indicates that a command that should have executed properly cannot be supported for some reason."}} 2021-05-29T10:32:49.3152180Z 2021-05-29T10:32:49.3153246Z 2021-05-29T10:32:49.3154557Z ========================================== 2021-05-29T10:32:49.3155640Z GET /session/1FFD03E0-6D3F-43CD-B7B8-0E1C89D1BC75/screenshot HTTP/1.1 2021-05-29T10:32:49.3156401Z 2021-05-29T10:32:49.3157693Z Accept: application/json, image/png 2021-05-29T10:32:49.3158559Z 2021-05-29T10:32:49.3159852Z Cache-Control: no-cache 2021-05-29T10:32:49.3160702Z 2021-05-29T10:32:49.3161998Z Host: 127.0.0.1:4723 2021-05-29T10:32:49.3162828Z 2021-05-29T10:32:49.3164370Z User-Agent: selenium/3.141.0 (.net windows) 2021-05-29T10:32:49.3166070Z 2021-05-29T10:32:49.3167429Z 2021-05-29T10:32:49.3168973Z 2021-05-29T10:32:49.3170018Z 2021-05-29T10:32:49.3171397Z HTTP/1.1 500 Internal Error 2021-05-29T10:32:49.3172131Z 2021-05-29T10:32:49.3173401Z Content-Length: 133 2021-05-29T10:32:49.3174246Z 2021-05-29T10:32:49.3175513Z Content-Type: application/json 2021-05-29T10:32:49.3176330Z 2021-05-29T10:32:49.3177375Z 2021-05-29T10:32:49.3178411Z 2021-05-29T10:32:49.3180542Z {"status":13,"value":{"error":"unknown error","message":"An unknown error occurred in the remote end while processing the command."}} 2021-05-29T10:32:49.3181399Z 2021-05-29T10:32:49.3182450Z 2021-05-29T10:32:49.3183767Z ========================================== 2021-05-29T10:32:49.3184904Z GET /session/1FFD03E0-6D3F-43CD-B7B8-0E1C89D1BC75/window_handles HTTP/1.1 2021-05-29T10:32:49.3185709Z 2021-05-29T10:32:49.3187024Z Accept: application/json, image/png 2021-05-29T10:32:49.3187862Z 2021-05-29T10:32:49.3189220Z Cache-Control: no-cache 2021-05-29T10:32:49.3190001Z 2021-05-29T10:32:49.3191270Z Connection: Keep-Alive 2021-05-29T10:32:49.3192167Z 2021-05-29T10:32:49.3193408Z Host: 127.0.0.1:4723 2021-05-29T10:32:49.3194293Z 2021-05-29T10:32:49.3195628Z User-Agent: selenium/3.141.0 (.net windows) 2021-05-29T10:32:49.3196398Z 2021-05-29T10:32:49.3197458Z 2021-05-29T10:32:49.3198488Z 2021-05-29T10:32:49.3199529Z 2021-05-29T10:32:49.3200771Z HTTP/1.1 200 OK 2021-05-29T10:32:49.3201638Z 2021-05-29T10:32:49.3202894Z Content-Length: 74 2021-05-29T10:32:49.3203717Z 2021-05-29T10:32:49.3205016Z Content-Type: application/json 2021-05-29T10:32:49.3205860Z 2021-05-29T10:32:49.3206891Z 2021-05-29T10:32:49.3207921Z 2021-05-29T10:32:49.3209310Z {"sessionId":"1FFD03E0-6D3F-43CD-B7B8-0E1C89D1BC75","status":0,"value":[]} 2021-05-29T10:32:49.3533298Z ##[section]Finishing: Stop - WinAppDriver


Actual Visual Test Task logs

image

2021-05-29T10:31:23.9347359Z ##[section]Starting: SubmitFeedbackTests 2021-05-29T10:31:23.9514668Z ============================================================================== 2021-05-29T10:31:23.9515029Z Task : Visual Studio Test 2021-05-29T10:31:23.9515781Z Description : Run unit and functional tests (Selenium, Appium, Coded UI test, etc.) using the Visual Studio Test (VsTest) runner. Test frameworks that have a Visual Studio test adapter such as MsTest, xUnit, NUnit, Chutzpah (for JavaScript tests using QUnit, Mocha and Jasmine), etc. can be run. Tests can be distributed on multiple agents using this task (version 2). 2021-05-29T10:31:23.9516504Z Version : 2.170.1 2021-05-29T10:31:23.9516727Z Author : Microsoft Corporation 2021-05-29T10:31:23.9517063Z Help : https://docs.microsoft.com/azure/devops/pipelines/tasks/test/vstest 2021-05-29T10:31:23.9517443Z ============================================================================== 2021-05-29T10:31:24.8601284Z SystemVssConnection exists true 2021-05-29T10:31:24.9042399Z SystemVssConnection exists true 2021-05-29T10:31:24.9873495Z Running tests using vstest.console.exe runner. 2021-05-29T10:31:24.9874070Z ====================================================== 2021-05-29T10:31:24.9875312Z Test selector : Test assemblies 2021-05-29T10:31:24.9875922Z Test filter criteria : Name=TC_95347_SubmittingFeedbackTest 2021-05-29T10:31:24.9876525Z Search folder : C:\BuildAgents\WDAgent4_work\2 2021-05-29T10:31:25.0344942Z Action when minimum tests threshold not met : donothing 2021-05-29T10:31:25.0345619Z Minimum tests expected to be run: 0 2021-05-29T10:31:25.2010704Z Run settings file : C:\BuildAgents\WDAgent4_work\2\s\Company.EnterpriseUX.Automation\Company.EnterpriseUX.Automation.UWP\Dev_Environment.runsettings 2021-05-29T10:31:25.2012501Z Run in parallel : false 2021-05-29T10:31:25.2013003Z Run in isolation : false 2021-05-29T10:31:25.2013514Z Path to custom adapters : null 2021-05-29T10:31:25.2014711Z Other console options : null 2021-05-29T10:31:25.2015294Z Code coverage enabled : false 2021-05-29T10:31:25.2016030Z Diagnostics enabled : false 2021-05-29T10:31:25.2017433Z SystemVssConnection exists true 2021-05-29T10:31:25.2022382Z Run the tests locally using vstest.console.exe 2021-05-29T10:31:25.2022726Z ======================================================== 2021-05-29T10:31:25.2024004Z Source filter: \debug*Automation.UWP.dll,!\obj** 2021-05-29T10:31:25.8215174Z SystemVssConnection exists true 2021-05-29T10:31:26.0261106Z [command]C:\BuildAgents\WDAgent4_work_tasks\VSTest_ef087383-ee5e-42c7-9a53-ab56c98420f9\2.170.1\Modules\DTAExecutionHost.exe --inputFile C:\BuildAgents\WDAgent4_work_temp\input_054a0c11-c069-11eb-a465-f5ac0076501e.json 2021-05-29T10:31:26.0369955Z ====================================================== 2021-05-29T10:31:26.0925694Z ########################################################################## 2021-05-29T10:31:26.0933024Z DtaExecutionHost version 18.170.30112.1. 2021-05-29T10:31:26.3869981Z Starting TestExecution Model... 2021-05-29T10:31:27.1862603Z Result Attachments will be stored in LogStore 2021-05-29T10:31:27.2096113Z Run Attachments will be stored in LogStore 2021-05-29T10:31:27.2204330Z Result Attachments will be stored in LogStore 2021-05-29T10:31:27.2480654Z Result Attachments will be stored in LogStore 2021-05-29T10:31:27.2484088Z Run Attachments will be stored in LogStore 2021-05-29T10:31:27.2657160Z Provided settings file: 2021-05-29T10:31:27.2670189Z <?xml version="1.0" encoding="utf-8" ?> 2021-05-29T10:31:27.2671002Z 2021-05-29T10:31:27.2671430Z 2021-05-29T10:31:27.2671869Z false 2021-05-29T10:31:27.2672495Z false 2021-05-29T10:31:27.2673631Z false 2021-05-29T10:31:27.2674238Z true 2021-05-29T10:31:27.2674738Z 2021-05-29T10:31:27.2675104Z
2021-05-29T10:31:27.2678810Z
2021-05-29T10:31:27.2679031Z 2021-05-29T10:31:27.2830635Z Updated Run Settings: 2021-05-29T10:31:27.2831577Z 2021-05-29T10:31:27.2831993Z 2021-05-29T10:31:27.2832256Z false 2021-05-29T10:31:27.2832589Z false 2021-05-29T10:31:27.2832923Z false 2021-05-29T10:31:27.2833279Z true 2021-05-29T10:31:27.2833601Z 1000 2021-05-29T10:31:27.2833999Z C:\BuildAgents\WDAgent4_work_temp\TestResults 2021-05-29T10:31:27.2834360Z 2021-05-29T10:31:27.2834609Z
2021-05-29T10:31:27.2834812Z
2021-05-29T10:31:27.2965615Z **** Starting test execution * 2021-05-29T10:31:27.3091551Z [command]C:\BuildAgents\WDAgent4_work_tool\VsTest\16.10.0\x64\tools\net451\Common7\IDE\Extensions\TestPlatform\vstest.console.exe "@C:\BuildAgents\WDAgent4_work_temp\tmnwpaadrah.tmp" 2021-05-29T10:31:27.3773850Z Microsoft (R) Test Execution Command Line Tool Version 16.10.0 2021-05-29T10:31:27.3774394Z Copyright (c) Microsoft Corporation. All rights reserved. 2021-05-29T10:31:27.3814972Z vstest.console.exe "C:\BuildAgents\WDAgent4_work\2\drop\Company.EnterpriseUX.Automation\Company.EnterpriseUX.Automation.UWP\bin\Debug\Company.EnterpriseUX.Automation.UWP.dll" 2021-05-29T10:31:27.3816171Z /TestCaseFilter:"Name=TC_95347_SubmittingFeedbackTest" 2021-05-29T10:31:27.3816888Z /Settings:"C:\BuildAgents\WDAgent4_work_temp\s20mbkzlwwk.tmp.runsettings" 2021-05-29T10:31:27.3817474Z /Logger:"trx" 2021-05-29T10:31:27.3818018Z /TestAdapterPath:"C:\BuildAgents\WDAgent4_work\2" 2021-05-29T10:31:28.0916750Z Starting test execution, please wait... 2021-05-29T10:31:28.3624208Z A total of 1 test files matched the specified pattern. 2021-05-29T10:31:29.0027985Z Multiple versions of same extension found. Selecting the highest version. 2021-05-29T10:31:29.0029142Z Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter : 14.0.5816.2 2021-05-29T10:32:35.6988375Z [Info] 5/29/2021 10:32:35 AM : Assembly Cleanup started 2021-05-29T10:32:35.6988975Z [Info] 5/29/2021 10:32:35 AM : Assembly Cleanup finished 2021-05-29T10:32:35.8947298Z Failed TC_95347_SubmittingFeedbackTest [32 s] 2021-05-29T10:32:35.8965379Z Error Message: 2021-05-29T10:32:35.8966579Z Initialization method Company.EnterpriseUX.Automation.UWP.Tests.SmokeTest.TestSetUp threw exception. OpenQA.Selenium.WebDriverException: An unknown error occurred in the remote end while processing the command.. 2021-05-29T10:32:35.8967685Z Stack Trace: 2021-05-29T10:32:35.8968665Z at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) 2021-05-29T10:32:35.8970102Z at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary2 parameters) 2021-05-29T10:32:35.8971035Z at OpenQA.Selenium.Remote.RemoteWebDriver.GetScreenshot() 2021-05-29T10:32:35.8972215Z at Company.EnterpriseUX.Automation.UWP.Utilities.Screenshot.CaptureScreenShot(WindowsDriver1 _session, String testCaseName) in C:\BuildAgents\WDAgent6_work\2\s\Company.EnterpriseUX.Automation\Company.EnterpriseUX.Automation.UWP\Utilities\Screenshot.cs:line 17 2021-05-29T10:32:35.8973848Z at Company.EnterpriseUX.Automation.UWP.BaseTest.CaptureLogs(Exception ex) in C:\BuildAgents\WDAgent6_work\2\s\Company.EnterpriseUX.Automation\Company.EnterpriseUX.Automation.UWP\Tests\BaseTest.cs:line 921 2021-05-29T10:32:35.8975239Z at Company.EnterpriseUX.Automation.UWP.BaseTest.TestSetUp() in C:\BuildAgents\WDAgent6_work\2\s\Company.EnterpriseUX.Automation\Company.EnterpriseUX.Automation.UWP\Tests\BaseTest.cs:line 183 2021-05-29T10:32:35.8981028Z Standard Output Messages: 2021-05-29T10:32:35.8982208Z [Info] 5/29/2021 10:31:32 AM : Selected Application Environment for Automation : [Dev] Company Digital - Enterprise 2021-05-29T10:32:35.8984553Z [Info] 5/29/2021 10:31:32 AM : Assembly Initialize started 2021-05-29T10:32:35.8985222Z [Info] 5/29/2021 10:31:32 AM : Starts the Windows Application Driver Service in AssemblyInitialize 2021-05-29T10:32:35.8986089Z [Info] 5/29/2021 10:31:32 AM : Windows Application Driver Server path : C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe 2021-05-29T10:32:35.8990026Z [Info] 5/29/2021 10:31:32 AM : Windows Application Driver Server is already running. 2021-05-29T10:32:35.8990941Z [Info] 5/29/2021 10:31:32 AM : The expected file presence in this path C:\Auto\DEV\TestResult_29_05_2021.csv : False 2021-05-29T10:32:35.8998090Z TestName,Status,Duration,ErrorMessage,Screenshot 2021-05-29T10:32:35.8998697Z [Info] 5/29/2021 10:31:32 AM : Application Data CleanUp started 2021-05-29T10:32:35.9000420Z [Info] 5/29/2021 10:31:32 AM : Launching of the UWP started 2021-05-29T10:32:35.9001036Z [Info] 5/29/2021 10:31:32 AM : Creating the Session started 2021-05-29T10:32:35.9002429Z [Error] 5/29/2021 10:32:02 AM : Error in launching WD Application by method-1 : The HTTP request to the remote WebDriver server for URL http://127.0.0.1:4723/session timed out after 30 seconds. : at OpenQA.Selenium.Appium.Service.AppiumCommandExecutor.Execute(Command commandToExecute) 2021-05-29T10:32:35.9018758Z at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary2 parameters) 2021-05-29T10:32:35.9019300Z at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities) 2021-05-29T10:32:35.9019832Z at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities) 2021-05-29T10:32:35.9020397Z at OpenQA.Selenium.Appium.Windows.WindowsDriver1..ctor(Uri remoteAddress, AppiumOptions AppiumOptions, TimeSpan commandTimeout) 2021-05-29T10:32:35.9021191Z at Company.EnterpriseUX.Automation.UWP.BaseTest.LaunchApp() in C:\BuildAgents\WDAgent6_work\2\s\Company.EnterpriseUX.Automation\Company.EnterpriseUX.Automation.UWP\Tests\BaseTest.cs:line 313 2021-05-29T10:32:35.9022469Z [Error] 5/29/2021 10:32:02 AM : Error in launching WD Application by method-2 : Object reference not set to an instance of an object. : at Company.EnterpriseUX.Automation.UWP.BaseTest.AttachAppSession(String windowName) in C:\BuildAgents\WDAgent6_work\2\s\Company.EnterpriseUX.Automation\Company.EnterpriseUX.Automation.UWP\Tests\BaseTest.cs:line 422 2021-05-29T10:32:35.9023725Z [Error] 5/29/2021 10:32:03 AM : Indicates that a command that should have executed properly cannot be supported for some reason. (104) : at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) 2021-05-29T10:32:35.9029392Z at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary2 parameters) 2021-05-29T10:32:35.9029860Z at OpenQA.Selenium.Remote.RemoteWindow.Maximize() 2021-05-29T10:32:35.9030455Z at Company.EnterpriseUX.Automation.UWP.BaseTest.LaunchApp() in C:\BuildAgents\WDAgent6\_work\2\s\Company.EnterpriseUX.Automation\Company.EnterpriseUX.Automation.UWP\Tests\BaseTest.cs:line 324 2021-05-29T10:32:35.9031349Z at Company.EnterpriseUX.Automation.UWP.BaseTest.ApplicationDataCleanUp() in C:\BuildAgents\WDAgent6\_work\2\s\Company.EnterpriseUX.Automation\Company.EnterpriseUX.Automation.UWP\Tests\BaseTest.cs:line 870 2021-05-29T10:32:35.9031981Z [Info] 5/29/2021 10:32:03 AM : Assembly Initialize finished 2021-05-29T10:32:35.9032381Z [Info] 5/29/2021 10:32:03 AM : Getting Build Version of the appxbundle started 2021-05-29T10:32:35.9033133Z [Info] 5/29/2021 10:32:03 AM : No appxbundle downloaded today, found in Path : C:\Builds\Dev on 5/29/2021. So please check whether build downloaded successfully. 2021-05-29T10:32:35.9034899Z [Info] 5/29/2021 10:32:03 AM : Starts the Windows Application Driver Service in Test TestInitialize 2021-05-29T10:32:35.9035565Z [Info] 5/29/2021 10:32:03 AM : Windows Application Driver Server path : C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe 2021-05-29T10:32:35.9036239Z [Info] 5/29/2021 10:32:03 AM : Windows Application Driver Server is already running. 2021-05-29T10:32:35.9036628Z [Info] 5/29/2021 10:32:03 AM : Test TestInitialize started 2021-05-29T10:32:35.9037024Z [Info] 5/29/2021 10:32:03 AM : Closing the Company UWP Application instance. 2021-05-29T10:32:35.9037402Z [Info] 5/29/2021 10:32:03 AM : Launching of the UWP started 2021-05-29T10:32:35.9037775Z [Info] 5/29/2021 10:32:03 AM : Creating the Session started 2021-05-29T10:32:35.9038639Z [Error] 5/29/2021 10:32:33 AM : Error in launching WD Application by method-1 : The HTTP request to the remote WebDriver server for URL http://127.0.0.1:4723/session timed out after 30 seconds. : at OpenQA.Selenium.Appium.Service.AppiumCommandExecutor.Execute(Command commandToExecute) 2021-05-29T10:32:35.9039630Z at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary2 parameters) 2021-05-29T10:32:35.9040111Z at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities) 2021-05-29T10:32:35.9040581Z at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities) 2021-05-29T10:32:35.9041124Z at OpenQA.Selenium.Appium.Windows.WindowsDriver1..ctor(Uri remoteAddress, AppiumOptions AppiumOptions, TimeSpan commandTimeout) 2021-05-29T10:32:35.9041845Z at Company.EnterpriseUX.Automation.UWP.BaseTest.LaunchApp() in C:\BuildAgents\WDAgent6\_work\2\s\Company.EnterpriseUX.Automation\Company.EnterpriseUX.Automation.UWP\Tests\BaseTest.cs:line 313 2021-05-29T10:32:35.9042985Z [Error] 5/29/2021 10:32:33 AM : Error in launching WD Application by method-2 : Object reference not set to an instance of an object. : at Company.EnterpriseUX.Automation.UWP.BaseTest.AttachAppSession(String windowName) in C:\BuildAgents\WDAgent6\_work\2\s\Company.EnterpriseUX.Automation\Company.EnterpriseUX.Automation.UWP\Tests\BaseTest.cs:line 422 2021-05-29T10:32:35.9044367Z [Error] 5/29/2021 10:32:33 AM : Indicates that a command that should have executed properly cannot be supported for some reason. (104) : at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) 2021-05-29T10:32:35.9045129Z at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary2 parameters) 2021-05-29T10:32:35.9045545Z at OpenQA.Selenium.Remote.RemoteWindow.Maximize() 2021-05-29T10:32:35.9046327Z at Company.EnterpriseUX.Automation.UWP.BaseTest.LaunchApp() in C:\BuildAgents\WDAgent6_work\2\s\Company.EnterpriseUX.Automation\Company.EnterpriseUX.Automation.UWP\Tests\BaseTest.cs:line 324 2021-05-29T10:32:35.9047879Z at Company.EnterpriseUX.Automation.UWP.BaseTest.TestSetUp() in C:\BuildAgents\WDAgent6_work\2\s\Company.EnterpriseUX.Automation\Company.EnterpriseUX.Automation.UWP\Tests\BaseTest.cs:line 172 2021-05-29T10:32:35.9049317Z [Error] 5/29/2021 10:32:33 AM : Indicates that a command that should have executed properly cannot be supported for some reason. (104) : at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) 2021-05-29T10:32:35.9050421Z at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters) 2021-05-29T10:32:35.9051023Z at OpenQA.Selenium.Remote.RemoteWindow.Maximize() 2021-05-29T10:32:35.9051969Z at Company.EnterpriseUX.Automation.UWP.BaseTest.LaunchApp() in C:\BuildAgents\WDAgent6_work\2\s\Company.EnterpriseUX.Automation\Company.EnterpriseUX.Automation.UWP\Tests\BaseTest.cs:line 324 2021-05-29T10:32:35.9053260Z at Company.EnterpriseUX.Automation.UWP.BaseTest.TestSetUp() in C:\BuildAgents\WDAgent6_work\2\s\Company.EnterpriseUX.Automation\Company.EnterpriseUX.Automation.UWP\Tests\BaseTest.cs:line 172 2021-05-29T10:32:35.9054473Z [Info] 5/29/2021 10:32:33 AM : Test TestInitialize finished 2021-05-29T10:32:35.9055071Z [Info] 5/29/2021 10:32:33 AM : Test : TC_95347_SubmittingFeedbackTest started 2021-05-29T10:32:35.9055894Z [Info] 5/29/2021 10:32:33 AM : Test : TC_95347_SubmittingFeedbackTest finished 2021-05-29T10:32:35.9056494Z [Info] 5/29/2021 10:32:33 AM : Test TestCleanUp started 2021-05-29T10:32:35.9057054Z [Info] 5/29/2021 10:32:33 AM : * Memory Usage on:VM_Name**** 2021-05-29T10:32:35.9057551Z [Info] 5/29/2021 10:32:33 AM : The Memory Use By WD App Test : 60 MB 2021-05-29T10:32:35.9058110Z [Info] 5/29/2021 10:32:33 AM : ** 2021-05-29T10:32:35.9058613Z TC_95347_SubmittingFeedbackTest : TestCleanup : 60 MB 2021-05-29T10:32:35.9058916Z
2021-05-29T10:32:35.9059563Z Tests the submitting feedback functionlaity from the application;;TC_95347_SubmittingFeedbackTest (DataRow ),Failed,00:00:32,Failure might be of sporadic one. Indicates that a command that should have executed properly cannot be supported for some reason. (104), 2021-05-29T10:32:35.9060336Z [Info] 5/29/2021 10:32:35 AM : Test TestCleanUp finished 2021-05-29T10:32:35.9294470Z Results File: C:\BuildAgents\WDAgent4_work_temp\TestResults\vishnu_VM_Name_2021-05-29_10_32_35.trx 2021-05-29T10:32:35.9464331Z Total tests: 1 2021-05-29T10:32:35.9465909Z Failed: 1 2021-05-29T10:32:35.9504943Z ##[error]Test Run Failed. 2021-05-29T10:32:35.9514808Z Total time: 1.1250 Minutes 2021-05-29T10:32:35.9767087Z Vstest.console.exe exited with code 1. 2021-05-29T10:32:35.9767606Z **** Completed test execution ***** 2021-05-29T10:32:35.9869432Z Test results files: C:\BuildAgents\WDAgent4_work_temp\TestResults\vishnu_VM_Name_2021-05-29_10_32_35.trx 2021-05-29T10:32:36.2981852Z Created test run: 1115560 2021-05-29T10:32:36.2984142Z Publishing test results: 1 2021-05-29T10:32:36.4298337Z Publishing test results to test run '1115560'. 2021-05-29T10:32:36.4329300Z TestResults To Publish 1, Test run id:1115560 2021-05-29T10:32:36.4409181Z Test results publishing 1, remaining: 0. Test run id: 1115560 2021-05-29T10:32:37.2249780Z Published test results: 1 2021-05-29T10:32:37.2257073Z Publishing Attachments: 1 2021-05-29T10:32:37.4923766Z Execution Result Code 1 is non zero, checking for failed results 2021-05-29T10:32:37.5690142Z Completed TestExecution Model... 2021-05-29T10:32:37.5937106Z ##[warning]Vstest failed with error. Check logs for failures. There might be failed tests. 2021-05-29T10:32:37.5940404Z ##[error]Error: The process 'C:\BuildAgents\WDAgent4_work_tasks\VSTest_ef087383-ee5e-42c7-9a53-ab56c98420f9\2.170.1\Modules\DTAExecutionHost.exe' failed with exit code 1 2021-05-29T10:32:37.5944220Z ##[error]Vstest failed with error. Check logs for failures. There might be failed tests. 2021-05-29T10:32:37.6081888Z ##[section]Finishing: SubmitFeedbackTests

anunay1 commented 3 years ago

From the logs the issue appears with your code, when you send a request:

2021-05-29T10:32:49.2982715Z {"using":"class name","value":"ApplicationFrameWindow"} 2021-05-29T10:32:49.2983706Z HTTP/1.1 200 OK

and then you get the responce as an empty list

2021-05-29T10:32:49.2990903Z 2021-05-29T10:32:49.2992299Z {"sessionId":"E7016455-A206-4C32-B30D-3B58FA8E67D7","status":0,"value":[]}

vishnuprakash9845 commented 3 years ago

@anunay1

Lets think there is issue with my code.

In the VM followed below steps 1.Launched WinAppDriver Manually image 2.Ran the Visual Studio tests its working fine

But here's the catch if the WinAppdriver is launched as task image

its failing so issue is not with respect to the code. Simple logic right.

After some careful observations of the logs what I understood is

In the WinAppDriver Launched as a Task app logs, (app,waitforAppLaunch) desired capabilities are missing, so its something to investigate in WinAppDriver task code I believe.

Launched WinAppDriver Manually Logs

Image1

=================================================================================================================================================================== Launched WinAppDriver as task logs

Image2
anunay1 commented 3 years ago

That could be an issue with azure task, but you can comment that line in your code. Because that only waits for max of 50 sec. And does not help in anyways with application with splash screen.

vishnuprakash9845 commented 3 years ago

@anunay1

Thank you for the response.

I’m sorry, I didn’t understand point mentioned. Issue with azure task means its Start WinAppDriver Task or Visual Studio Test Task you are referring to.

If you want me to comment the line in code which is that line in the below image [Below Code it to launch the Application].

image

anunay1 commented 3 years ago

Start WinAppDriver Task notVisual Studio Test Task . Start WinAppDriver task could have been developed on a older version of WAD. comment the line 309.

vishnuprakash9845 commented 3 years ago

@anunay1 @timheuer @DHowett @fforjan

Can we raise a small bug about the above the issue in WinAppDriver Task and track it to get the fix. Such that WinAppDriver will be more flexible and stable to use as devops task in pipleine.

https://marketplace.visualstudio.com/items?itemName=WinAppDriver.winappdriver-pipelines-task&ssr=false#overview

I wrote to hassan.uraizee@microsoft.com still no reply, can any one take this forward.

I hope you find this helpful.