3

I have an iPhone application that contains a UIWebView for rendering certain UI aspects. The UIWebView content communicates with the Objective-C side through NSURLRequests. I'd like to test the UIWebView contents with Selenium so it could be automated.

The problem is the communication with the native side, as this is not supported by Selenium. Therefore, a way is needed to "fake" the Objective-C side. The UIWebView sends requests to a specific (non-existant) URL that are then interpreted by the native code and processed. When running the UIWebView's contents with Selenium, these requests will always fail.

Is there a way to somehow provide support in Selenium that would allow catching these requests and providing a dummy response, or is there a better tool for this?

Preferably, I'd also like to run the Selenium tests with Sauce Labs, or a similar Selenium service, so hacking /etc/hosts is not an option either.

ljs.dev
  • 4,031
  • 2
  • 40
  • 76
TuomasR
  • 2,256
  • 17
  • 28

1 Answers1

2

Have you tried Appium? It should allow you to write WebDriver tests that invoke the UIAutomation library.

Ross Rowe
  • 397
  • 4
  • 9