使用 appium 执行量角器脚本时等待异步脚本结果超时 [英] Timed out waiting for asynchronous script result while executing protractor scripts with appium
问题描述
我在量角器中运行多个测试时遇到问题:60010 秒后等待异步脚本结果超时在登录脚本之后执行的教程脚本代码:
I have a problem while running more than one test in protractor : Timed out waiting for asynchronous script result after 60010 s The code of tutorial script which is executed just after the login script :
这是我在我的配置文件中使用的代码
Here the code i'm using in my config file from A Code proposed in another question but it didn't solve my problem !
PS:即使我为元素放置了不正确的位置,我也会出现超时错误,而不是找不到此元素!好像那行代码点击进入教程按钮"从未执行过
- 是不是因为教程进行了ajax调用?
这是我的 html 代码:
PS : Even if i put an incorrect location for the element i have the error of time out and not this element cannot be found ! as if that line of code "the click into tutorial button" is never executed
Is it because tutorial make an ajax call ?
</div></md-content></div></div><!-- Google Analytics:将 UA-XXXXX-X 更改为您网站的 ID --><!--<脚本>--><!--!function(A,n,g,u,l,a,r){A.GoogleAnalyticsObject=l,A[l]=A[l]||function(){--><!--(A[l].q=A[l].q||[]).push(arguments)},A[l].l=+new Date,a=n.createElement(g),--><!--r=n.getElementsByTagName(g)[0],a.src=u,r.parentNode.insertBefore(a,r)--><!--}(window,document,'script','https://www.google-analytics.com/analytics.js','ga');--><!--ga('create', 'UA-XXXXX-X');--><!--ga('send', 'pageview');--><!--</script>--><script src="scripts/vendor.js"></script><script src="cordova.js"></script><script src="scripts/scripts.js"></script><script src="https://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/sha1.js"></script><script src="https://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/sha256.js"></script><script src="https://crypto-js.googlecode.com/svn/tags/3.1.2/build/components/enc-base64-min.js"></script><div class="introjs-overlay" style="top: 0;bottom: 0; left: 0;right: 0;position: fixed;opacity: 0.8;"></div><div class="introjs-helperLayer " style="width: 538px; height:366px; top:64px;left: 195px;"></div><div class="introjs-tooltipReferenceLayer" style="width: 538px; height:366px; top:64px;left: 195px;"><div class="introjs-tooltip" style="left: 546px;"><div class="introjs-tooltiptext">监视列表视图.向左滑动网格中的行以显示删除操作.</div><div class="introjs-bullets"><ul><li><a class="active" href="javascript:void(0);"data-stepnumber="1"></a></li><li><a href="javascript:void(0);"data-stepnumber="2"> </a></li><li><a href="javascript:void(0);"data-stepnumber="3"></a></li><li><a href="javascript:void(0);"data-stepnumber="4"> </a></li><li><a href="javascript:void(0);"data-stepnumber="5">></a></li><li><a href="javascript:void(0);"data-stepnumber="6"></a></li><li><a href="javascript:void(0);"data-stepnumber="7"> </a></li><li><a href="javascript:void(0);"data-stepnumber="8"></a></li></ul></div><div class="introjs-progress" style="display: none;"><div class="introjs-progressbar" style="width:12.5%;"></div></div><div class="introjs-arrow left" style="display:继承;"></div><div class="introjs-tooltipbuttons"><a class="introjs-button introjs-skipbutton" href="javascript:void(0);">Don'不要再显示它!</a><a href="javascript:void(0);"class="introjs-button introjs-prevbutton introjs-disabled" tabindex="-1">Previous</a><a href="javascript:void(0);"class="introjs-button introjs-nextbutton">Next</a></div></div></div></body></html>
</div></md-card-content> </md-card><!-- end ngIf: !expandChart --> </div> </div> </div></md-content> </div></div> <!-- Google Analytics: change UA-XXXXX-X to be your site's ID --> <!--<script>--> <!--!function(A,n,g,u,l,a,r){A.GoogleAnalyticsObject=l,A[l]=A[l]||function(){--> <!--(A[l].q=A[l].q||[]).push(arguments)},A[l].l=+new Date,a=n.createElement(g),--> <!--r=n.getElementsByTagName(g)[0],a.src=u,r.parentNode.insertBefore(a,r)--> <!--}(window,document,'script','https://www.google-analytics.com/analytics.js','ga');--> <!--ga('create', 'UA-XXXXX-X');--> <!--ga('send', 'pageview');--> <!--</script>--> <script src="scripts/vendor.js"></script> <script src="cordova.js"></script> <script src="scripts/scripts.js"></script> <script src="https://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/sha1.js"></script> <script src="https://crypto-js.googlecode.com/svn/tags/3.1.2/build/rollups/sha256.js"></script> <script src="https://crypto-js.googlecode.com/svn/tags/3.1.2/build/components/enc-base64-min.js"></script> <div class="introjs-overlay" style="top: 0;bottom: 0; left: 0;right: 0;position: fixed;opacity: 0.8;"></div><div class="introjs-helperLayer " style="width: 538px; height:366px; top:64px;left: 195px;"></div><div class="introjs-tooltipReferenceLayer" style="width: 538px; height:366px; top:64px;left: 195px;"><div class="introjs-tooltip" style="left: 546px;"><div class="introjs-tooltiptext">Watchlist view. Swipe the row in the grid to the left to show the delete action.</div><div class="introjs-bullets"><ul><li><a class="active" href="javascript:void(0);" data-stepnumber="1"> </a></li><li><a href="javascript:void(0);" data-stepnumber="2"> </a></li><li><a href="javascript:void(0);" data-stepnumber="3"> </a></li><li><a href="javascript:void(0);" data-stepnumber="4"> </a></li><li><a href="javascript:void(0);" data-stepnumber="5"> </a></li><li><a href="javascript:void(0);" data-stepnumber="6"> </a></li><li><a href="javascript:void(0);" data-stepnumber="7"> </a></li><li><a href="javascript:void(0);" data-stepnumber="8"> </a></li></ul></div><div class="introjs-progress" style="display: none;"><div class="introjs-progressbar" style="width:12.5%;"></div></div><div class="introjs-arrow left" style="display: inherit;"></div><div class="introjs-tooltipbuttons"><a class="introjs-button introjs-skipbutton" href="javascript:void(0);">Don't show it again!</a><a href="javascript:void(0);" class="introjs-button introjs-prevbutton introjs-disabled" tabindex="-1">Previous</a><a href="javascript:void(0);" class="introjs-button introjs-nextbutton">Next</a></div></div></div></body></html>
推荐答案
最后,我尝试通过添加此回调来解决我的问题
Finally i tried to solve my problem by adding this call back
describe("long asynchronous specs", function() {
beforeEach(function(done) {
done();
}, 10000);
});
这里是 jasmine Asynchronous_Support 的链接,帮助我理解时间出问题.希望能帮到你,
Here is a link from jasmine Asynchronous_Support that help me understand time out problems. Hope that can help you,
这篇关于使用 appium 执行量角器脚本时等待异步脚本结果超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!