- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
版本:“webdriverio”:“^5.7.5”,
如果我不清楚,请提前致歉,请让我知道并相应地传递我的意见。
我在公司代理后面运行我的 wdio5 脚本。它在所有浏览器上成功运行。我尝试将 API 调用集成到框架中,但开始遇到多个问题。
像 supertest、axios [包括 httpsProxyAgent]、sync-request、then-request 这样的 API 库不读取 wdio 使用的 npm 代理变量。因此,我在 API 调用中收到以下错误消息
Error: getaddrinfo ENOTFOUND qa.internalurl.co.ukqa.internalurl.co.uk:443
-request、fetch-with-proxy 等 API 库通过使用代理设置成功调用 API。我需要“等待”他们的回应,因此将我的 it block 移动为异步函数。但是在作为异步调用成功响应后,我收到以下错误消息
[chrome #0-0] $(...).waitForExist is not a function
[chrome #0-0] TypeError: $(...).waitForExist is not a function
不仅仅是 waitForExist, session 几乎无法记住任何 selenium/webdriverio 命令。很明显,当它切换到异步调用以获取 promise 响应时,它正在失去 selenium 连接。
有办法解决吗?
let accountNo = "123456";
it.only('verify the dashboard page ',async () => {
//launches the browser url and cleans the cookies
try {
response = await apiCheck.postApiLoginData(accountNo);
//Makes to call to API function to get the values
} catch (err) {
console.error(err);
}
console.log(response); //prints the successful response data
lPage.enterLoginData(accountNo, 'pass1234'); //Fails here as the data is
addStep(`Login to the Standard application using username as ${accountNo} and PIN as 74437`);
lPage.assertSummaryPage(response);
}
没有 Try block 代码,成功登录到应用程序。
最佳答案
处理非wdio异步代码,需要使用the browser.call
function .例如:
response = browser.call(() => {
return apiCheck.postApiLoginData(accountNo);
//Makes to call to API function to get the values
})
关于javascript - wdio 异步调用在调用 promise 调用时丢弃 Selenium 连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55815751/
(>>)的定义功能如下:(>>) :: Monad m => m a -> m b -> m b但我想实现这个功能翻转如下: 我有一个函数tabulate :: Int -> [Int] -> IO
我在新线程中创建一个新的托管对象上下文,并向其中插入一些对象。我可以通过不保存上下文来丢弃(忘记它们)它们吗?我的问题是这样的:我开始一个漫长的过程,在开始时创建一些 NSManagedObjects
关闭。这个问题是opinion-based .它目前不接受答案。 想改善这个问题吗?更新问题,以便可以通过 editing this post 用事实和引文回答问题. 3年前关闭。 Improve t
虽然建议打开编译器标志,如 -Wvalue-discard或 -Wunused:implicits通过使用 sbt-tpolecat 显式或隐式地. 有时您需要解决这些问题,但要以一种明确的方式;因为
在 R 中,na.omit()函数可用于丢弃包含 NA 值的 data.frame 中的条目。作为副作用,如果确实丢弃了行,则该函数会向结果添加一个属性 'omit',其中包含被丢弃的 row.nam
使用 geom_blank我想添加一些新的因子水平,但我似乎无法这样做并保留 NA水平 library('ggplot2') pl <- ggplot(data.frame(x = factor(c(
谁能告诉我两者之间是否有什么区别 DROP IF EXISTS [TABLE_NAME] DROP [TABLE_NAME] 我问这个问题是因为我在 MVC Web 应用程序中使用 JDBC 模板。如
例如,我有以下表达式映射: function! DelNthSpace() let col=match(getline('.'), '[[:blank:] ]', col('.'
默认情况下,Chrome 会丢弃后台未使用的选项卡以节省内存。 我想知道是否有一种方法可以让我现在可以在我的网站被 Chrome 丢弃的情况下 - 这样我就可以告诉我的用户,下次他们进入时,如何避免这
我的数据库中有一个元素列表,每个元素都有自己的日期时间字段。我想丢弃比今天更旧的元素,这意味着我只会看到 future 的元素。 这是我当前的代码: def get_dates_approved(re
我为我的 linux 机器编写了一个 C++ 工具,它接收 UDP (OSC) 数据包并立即将它们发回(这是它唯一做的事情)。但似乎有一些丢弃的数据包。当我向我的 linux(从另一台机器)发送 10
在创建 cron 作业时,我总是这样写: 15 0 * * * /somepath/somescript.pl > /dev/null 2>&1 关于末尾“>/dev/null 2>&1”丢弃所有st
我已经四处寻找有关此问题的指示,但找不到任何指示。假设我有一个 Python 列表: list = set([((3, 2), (2, 1)), ((3, 2), (3, 1)
我正在介绍 C,我需要编写一个程序来提示用户输入字符、等号和整数。我需要使用 getchar() 直到 '=' 然后使用 scanf() 获取整数。然后程序应该只输出整数返回给用户。 现在它打印出不必
如何忽略数据框中随机分布在数据框中的空单元格?这是我的例子 ColA ColB ColC ColD ColF ColG ColH A
我无法在网上找到我的问题的单一答案... 我正在为我的投资组合构思一个网站创意,并决定涉足一些 jQuery 让它更令人兴奋。我正确链接了 jQuery 并且工作,但是当我使用 .toggle 方法时
据我了解,在 Linux 中创建虚拟驱动器的过程是这样的 fallocate -l size /path/to/file.img; dd if=/dev/zero of=/path/tofile.im
大多数时候,我都是这样做的。 class a { public: ~ a() { i = 100; // OK delete (int *)j
下面的代码编译。它似乎运行良好。 但是它会导致任何未定义的行为吗? 我想抛弃 *this 的常量。 这是为了允许 const my_iterator 改变它指向的数据。 测试: class A { p
这个问题在这里已经有了答案: 关闭 10 年前。 Possible Duplicate: Is const_cast safe? 显然我永远不会写这段代码,但它是真实程序中出现的一个非常简单的例子。
我是一名优秀的程序员,十分优秀!