超时等待异步脚本结果硒C#量角器 [英] Timed out waiting for async script result Selenium C# Protractor

查看:292
本文介绍了超时等待异步脚本结果硒C#量角器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图创建使用Protractor.net一个AngularJS平台自动化测试脚本,在C#中的硒。我已经创建使用下面的代码司机

I'm trying to create an automation test script using Protractor.net for an AngularJS platform, with Selenium in C#. I've created the driver using the below code.

driver = new FirefoxDriver();
Ngdriver = new NgWebDriver(driver);



然后试图查找和元素如下:

And then attempted to locate and element as follows:

Ngdriver.FindElement(NgBy.Model("vm.reference")).SendKeys("Test");



不过,我收到一个例外:45ms后超时等待异步脚本结果

However, I'm receiving an exception: Timed out waiting for async script result after 45ms.

在此先感谢

推荐答案

我使用SetScriptTimeout解决了这一点。

I resolved this by using the SetScriptTimeout.

ngDriver.Manage().Timeouts().SetScriptTimeout(TimeSpan.FromSeconds(10));

这篇关于超时等待异步脚本结果硒C#量角器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆