问题
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
回答1:
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.
回答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.
来源:https://stackoverflow.com/questions/56104320/how-can-you-interact-with-the-windows-desktop-when-using-testcafe