简体   繁体   English

appium ios python“执行用户提供的javascript时发生错误”

[英]appium ios python “an error occured while executing user supplied javascript”

I'm using a bit Appium (v1.3.7) to make nice tests! 我正在使用一些Appium(v1.3.7)进行不错的测试! And I'm trying to have tests that runs on both Android and iOS. 我正在尝试在Android和iOS上运行测试。 I'm testing directly on the phones not on simulators and using python to write tests. 我直接在手机上而不是模拟器上进行测试,并使用python编写测试。

I got a test to test if an ad banner is displayed and if I can click on it. 我进行了测试,以测试是否显示广告横幅以及是否可以单击它。

Simple enough on Android I open the application and navigate to the right place, then send a press event and assert that the elements of my application are no longer visible (since now we have the phone store openned at "download application" or something similar) 在Android上足够简单,我打开应用程序并导航到正确的位置,然后发送一个新闻事件并断言我的应用程序的元素不再可见(因为现在我们在“下载应用程序”或类似位置打开了电话存储)

It's 2 lines: 这是2行:

e1 = TouchAction(self.webdriver)
e1.press(x=300, y=1200).release().perform()

It's working on Android, but on iOS it returns the exception : "an error occured while executing user supplied javascript" whenever I call the perform action. 它可以在Android上运行,但是在iOS上,它会返回异常:每当我调用perform动作时,“执行用户提供的javascript时发生错误”。

All of this is done in a native application if it can help. 如果有帮助,所有这些操作均在本机应用程序中完成。 The rest of appium is working fine I can move into my application and all but since here my ads can be pretty random I only had the "press where the ad should be" solution. 其余的appium都可以正常运行,我可以进入我的应用程序,但由于我的广告在这里可能是非常随机的,所以我只有“按广告位置”解决方案。

Also fruitsrap keep failing whenever I launch a test. 每当我启动测试时,fruitsrap也会不断失败。 Might be linked even if I found out that it should not be used anymore ( https://github.com/appium/appium/issues/4501 ) 即使我发现不应再使用它,也可能会被链接( https://github.com/appium/appium/issues/4501

Do anyone knows what's happening in there? 有人知道那里发生了什么吗?

Figured what was wrong, the x and y positions were out of bound, the screen resolution of the phone was smaller than I thought. 找出问题所在,x和y位置超出范围,电话的屏幕分辨率比我想象的要小。

It's working properly with in bound values. 它在绑定值中正常工作。 But the error message should be more explicit :) 但是错误消息应该更明确:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM