2

I need to use TestCafe to perform actions within our Electron app, however I also need to perform actions on the Windows desktop (e.g. click taskbar, launch other apps).

Since TestCafe can only interact with what is within the browser window, I have attempted to use Appium to essential run TestCafe (calling the commandline from C#) and then performing the Windows desktop actions through WinAppDriver however this feels like a kludge.

Are there other methods of arranging this or a framework that would be more elegant?

Thanks for any insights

m

Alex Skorkin
  • 4,264
  • 3
  • 25
  • 47
Maximojo
  • 315
  • 5
  • 17

2 Answers2

3

You are right - TestCafe can only interact with what is within the browser window, but not outside it.

You can also check out the testcafe-browser-provider-webdriverio plugin. Its author claims that this provider can connect to an Appium server.

Alex Skorkin
  • 4,264
  • 3
  • 25
  • 47
  • so looking at [the API usage section](https://github.com/fnlctrl/testcafe-browser-provider-webdriverio#usage) I could have my testcafe Electron script and Appium WinAppDriver script in the same script file but create different runners for each? And interleave calls to each. – Maximojo May 13 '19 at 10:51
  • I have not used that third-party plug-in. You might want to submit your inquiry directly to the repository so the author can provide you with a precise solution. – Alex Skorkin May 13 '19 at 13:25
  • 1
    Asked the question here for those interested: https://github.com/fnlctrl/testcafe-browser-provider-webdriverio/issues/3 – Maximojo May 27 '19 at 21:56
2

I have successfully used robotjs to interact with the desktop (mouse move, click, etc.). This seems to be an excellent choice at the moment. Just install alongside TestCafe in your node project.

Maximojo
  • 315
  • 5
  • 17