appium / dotnet-client

Extension to the official Selenium dotnet webdriver
Apache License 2.0
381 stars 187 forks source link

[Bug]: The driver.Context function in C# returns /wd/hub/session/{sessionid}/contexts in the path instead of context #667

Closed MateuszC05 closed 12 months ago

MateuszC05 commented 12 months ago

Should the driver.Context function in C# return /wd/hub/session/{sessionid}/contexts in the path?

When I try to switch to the context webview from visual studio it throws me an HTTP error, in the console it is [HTTP] --> POST /wd/hub/session/f5cc0273-e548-4d8a-bec1-2a77a380b24c/contexts [HTTP] { "name": "WEBVIEW_com.appname.app.dev"} [debug] [HTTP] Route not found for /wd/hub/session/f5cc0273-e548-4d8a-bec1-2a77a380b24c/contexts [HTTP] <-- POST /wd/hub/session/f5cc0273-e548-4d8a-bec1-2a77a380b24c/contexts 404 3 ms - 262 [HTTP] [HTTP] --> GET /wd/hub/session/3622d733-c9c2-497b-800d-389c22a75df5/timeouts

As I do this from the appium inspector, it works because at the end of the POST it returns contexts and not contexts.

The screen below is from the appium gui and it works there, however, releasing the tests from visual studio when I use the driver.Context function it throws me an error, I think it is by adding contexts instead of context in the POST path 2023-10-11 09_55_54-Should the driver Context function in C# return in the path _wd_hub_session_{ses

Dor-bl commented 12 months ago

Please write the appium dotnet client version you are using

MateuszC05 commented 12 months ago

[v4.4.5]

MateuszC05 commented 12 months ago

please help, it is blocking me from a very important task

Dor-bl commented 12 months ago

v4.4.5 is no longer supported, please use v5.0 RC

MateuszC05 commented 12 months ago

I don't see an update in the nuget package manager, should I update it manually?

Dor-bl commented 12 months ago

Select pre release versions to see the RC

MateuszC05 commented 12 months ago

Well, I did so, but I can not zaincializ dirver, I have the current version of selenium, I get this error pops up. Do you know what it could be about? image

Dor-bl commented 12 months ago

Version 5.0 had some major breaking changes, you will need to modify your code accordingly. You can take a look at the test folder in the main branch for code examples. I didn't had the time to prepare a proper migration guide just yet.

MateuszC05 commented 12 months ago

How to start testing a mobile application in 5.0 rc version? I can't find instructions anywhere, the connections like in appium 4.4.5 don't work, can you describe to me how the start test should look like that opens the app in question for me on a physical android device?

MateuszC05 commented 12 months ago

image this dosent work

Dor-bl commented 12 months ago

Have a look here https://github.com/appium/dotnet-client/blob/main/test/integration/helpers/Caps.cs#L20

MateuszC05 commented 12 months ago

assigning capabilities to AppiumOptions does not image return options as shown in the following screenshot

MateuszC05 commented 12 months ago

How to start testing a mobile application in 5.0 rc version? i must add a capabilities like previous version

Dor-bl commented 12 months ago

Not sure why for you it's not working locally, looks like environment issue.