How to simulate a mouse click on a UIWebView in Cocoa for the iPhone?
Posted
by eagle
on Stack Overflow
See other posts from Stack Overflow
or by eagle
Published on 2010-04-24T02:59:35Z
Indexed on
2010/04/28
23:07 UTC
Read the original article
Hit count: 575
I'm trying to setup automated unit tests for an iPhone application. I'm using a UIWebView and need to simulate clicks on different links. I've tried doing this with JavaScript, but it doesn't produce the same result as when I manually click on the links. The main problem is with links that have their target
property set.
I believe the only way for this automated unit test to work correctly is to simulate a mouse click at a specific x/y coordinate (i.e. where the link is located). Since the unit testing will only be used internally, private API calls are fine.
It seems like this should be possible since the iPhone app isimulate seems to do something similar.
Is there any way to do this in the framework?
© Stack Overflow or respective owner