Skip to content
Please

Testcafe And Device Farm

Programming, Testing, TestCafe, AWS Device Farm1 min read

I have been trying to figure out how to get TestCafe to run inside of AWS Mobile Device Farm. My team owns a website and I want to be able to test the website on real mobile devices.

TestCafe can run tests either on a local browser or a remote browser. In both cases TestCafe will spin up a small web server and handle communicating instructions to the browser.

The first challenge with trying to automate testing in DeviceFarm was figuring out how to get TestCafe to spin up and communicate with an iOS device.

This proved to be a bit difficult to do due to my poor understanding of how Appium works. After a bunch of slight modifications to the yaml configuration I was able to get TestCafe to attempt to start up but I kept getting an error because TestCafe was trying to open an application called TestCafe Browser Tools. I cut a bug to TestCafe to see if they could fix this and in doing so stumbled across this pull request and applying the change to my local set up seemed to get me past that error. Now I had a TestCafe server up and running and using the testcafe-browser-provider-selenium I was able to connect to the server... Sort of.

The next, and bigger problem, was that DeviceFarm mobile devices can only connect to the public internet. This means that the mobile device I am testing with can't actually connect to the Mac that is controlling it.

If I ever figure out a good way to automate tests on devices I will be sure to post an update. For now I am looking at BrowserStack as an alternative.