microsoft / WinAppDriver

Windows Application Driver
MIT License
3.7k stars 1.41k forks source link

Perform tests on same app twice #1715

Open Eirel opened 2 years ago

Eirel commented 2 years ago

Hey WinAppDriver community !

We've developped an windows desktop app based over gRPC protocol to allow communication between two instances of the said app over a specific network. We've also designed tests using appium, but we encounter issues when the tests run: for no reason, the selection of element by id or by name select element on the invalid instance. Let me give an example:

We run a new session using the first instance of the app. On this app, we select a checkbox using id 'xChkAutomate', and click to check it. The checkbox gets checked correctly We run a second session, using the second instance of the same app (some inside code allows the whole process to work on a single machine, for test purpose). We then try to select the xChkAutomate box on the session2, but randomly, the box on the first session get's selected rather than the second one.

It's surely due to the fact that this is the same app, having the same id, but we were expecting the session to handle this kind of issue, Is there a way to do so ?

anunay1 commented 2 years ago

Can you please share the code? I have used in my project and it works flawlessly?