For this line of test code : view.scrollViews()[0].tapWithOptions({tapOffset:{x:0.32, y:0.25}})
I am getting this error
2012-11-02 18:09:23 +0000 None: Script threw an uncaught JavaScript error: target.frontMostApp().mainWindow().scrollViews()[0] could not be tapped on line 244 of feature.js
2012-11-02 18:09:23 +0000 Debug: target.frontMostApp().mainWindow().scrollViews()[0].tapWithOptions({tapOffset:{x:"0.32", y:"0.25"}})
2012-11-02 18:09:23 +0000 Debug: target.frontMostApp().mainWindow().scrollViews()[0].scrollToVisible()
2012-11-02 18:09:23 +0000 Debug: target.frontMostApp().mainWindow().scrollViews()[0] - scrollToVisible cannot be used on the element because it does not have a scrollable ancestor.
2012-11-02 18:09:23 +0000 Debug: target.frontMostApp().mainWindow().scrollViews()[0] - scrollToVisible cannot be used on the element because it does not have a scrollable ancestor.
2012-11-02 18:09:23 +0000 Debug: target.frontMostApp().mainWindow().scrollViews()[0] could not be tapped
The logelement tree looks like this
UIATarget "MyiPadname" {{0, 0}, {1024, 768}}
elements: {
UIAApplication "myAppName" {{0, 0}, {1024, 768}}
elements: {
UIAWindow "(null)" {{0, 0}, {1024, 768}}
elements: {
UIAScrollView "(null)" {{0, 0}, {1024, 768}}
elements: {
UIAImage "(null)" {{1017, 761}, {7, 7}}
UIAImage "(null)" {{1017, 761}, {7, 7}}
}
UIAImage "nav_bar.png" {{0, 724}, {1024, 44}}
UIAButton "button featured" {{0, 730}, {134, 39}}
UIAButton "See the world" {{134, 730}, {223, 39}}
UIAButton "button my favorites" {{357, 730}, {180, 39}}
UIAButton "button settings" {{967, 736}, {33, 27}}
}
}
}
I am using XCode 4.5.1 . Can anyone help me to fix this . Thanks
Are you, by any chance, using iOS 5.x simulator or iOS 5.x device? If yes then I am seeing the same issue. I believe Xcode 4.5.1 does not like ScrollViews.
But, I found a workaround.
My element is looks like :
target.frontMostApp().mainWindow().scrollViews()[0].buttons()["Wikipedia"]
So, instead of accessing the button directly, I am trying to access a staticText for the button.
target.frontMostApp().mainWindow().scrollViews()[0].buttons()["Wikipedia"].staticTexts()["Wikipedia"].tap();
I hope this works for you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With