dotnet-client icon indicating copy to clipboard operation
dotnet-client copied to clipboard

[feature requst]: Attaching to Existing SessionId

Open alijundi opened this issue 11 months ago • 7 comments

I have tried my best to attach to existing SessionId. I don't want to create a new session. I already know how to do that.

Is there a way to connect to existing session using appium dotnet client?

alijundi avatar Feb 15 '25 07:02 alijundi

I don't think selneium .net client doesn't provide such a feature. This project itself as well. Renamed to a feature request.

KazuCocoa avatar Feb 15 '25 09:02 KazuCocoa

Hi @nvborisenko, what's your estimated effort to add such feature if it's even possible on selenium side?

Dor-bl avatar Feb 15 '25 10:02 Dor-bl

I propose to understand use case, hidden by the feature request. Opposite opinion would be "why not to keep existing client object, who initiated new session, instead of creating new client with attaching to existing session". Probably there is a better solution.

nvborisenko avatar Feb 15 '25 10:02 nvborisenko

@alijundi, I agree with @nvborisenko. Can you please elaborate on your use case before we go any further? Where exactly do you start the session you plan to "ride" in the following steps?

Dor-bl avatar Feb 15 '25 20:02 Dor-bl

I need to use this similar to appium inspector. I want to connect to android and when I do that the existing session is terminated and a new one is made. In appium inspector I can attach to existing session making it much easier for debugging and will not create many stale sessions on the appium server. It is necessary! And much needed!

alijundi avatar Feb 16 '25 04:02 alijundi

So you want to develop .net application, who can attach to the existing session? And evaluate it?

@Dor-bl I walk through selenium code quickly. Only one concern: when client starts new session, remote-end returns capabilities object which may be used later. So attaching as a concept doesn't applicable at all.

One more opinion from Firefox team:

Its not possible for WebDriver classic, but with BiDi you can attach a new client to the same session. Ideally you can even have multiple sessions which for now is implemented in Chrome but not yet in Firefox

Probably this opinion is not related to Appium.

In any case Selenium team can "expose a possibility" to attach to the session by ID, but before doing it let's clearly understand why we want to do it.

nvborisenko avatar Feb 17 '25 20:02 nvborisenko

@alijundi, in case you need us to add support, we first need to understand your motivation.

Dor-bl avatar Mar 16 '25 20:03 Dor-bl

Closing this ticket due to a lack of response.

Dor-bl avatar Oct 08 '25 12:10 Dor-bl