One of the interesting side effects was that calling click() on the WebElement used to work, but after the upgrade those tests failed. For which I found this discussion that led me into trying to use tap(). I fumbled for a little since:
- We have a hybrid app and we've focused all our work in the WEB_VIEW context. Turns out calling tap in that context doesn't work and you have to switch to NATIVE_APP context.
- Then I tried using the tap(fingers, WebElement, duration) variation of the method, but that would crash Appium an error "uncaughtException: Cannot read property 'x' of undefined".
- I haven't nailed this down, but I'm guessing this is because I found the WebElement in the WEB_VIEW context, then switched to NATIVE_APP context to tap.
- Finally used the x, y coordinates of the WebElement and used the tap(fingers, x, y, duration) method to actually do the tap.
Then I ran into another issue - the location of the WebElement wasn't quite right. First off we are still running in compatibility mode which caused the location of things to be fairly far off when using the iPhone 6 simulator - at least that's our current theory. When using the iPhone 5 simulator things seemed more consistent. The y coordinate was still off by a little that we had to add as an offset - 26 pixels. The theory we have for this is that the changes in iOS 7 to make the status bar transparent might be behind this.
No comments:
Post a Comment