标签: webdriver-io-v4

Window10 上的 Webdriverio 错误 basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')") ^^^^^^^ SyntaxError: missing ) 在参数列表之后

当我尝试运行 npm run 然后我得到以下错误我使用以下配置:
webdriverio v4.14.4

node v8.5

npm v5.3

Windows 10

下面是我的配置文件

"scripts":{
"web": "node node_modules/.bin/wdio ./test/config/suite.web.conf.js",
}
Run Code Online (Sandbox Code Playgroud)

以下错误:

> $ npm run web
>  tconnect-uiautomation@1.1.5 web >C:\Users\user\Downloads\webdriverioFramework\webdriverioFramework 
>ENV=preprod node node_modules/.bin/wdio ./test/config/suite.web.conf.js

C:\Users\user\Downloads\webdriverioFramework\webdriverioFramework\node_modules\.bin\wdio:2
> basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
>           ^^^^^^^
> 
> SyntaxError: missing ) after argument list
>     at createScript (vm.js:74:10)
>     at Object.runInThisContext (vm.js:116:10)
>     at Module._compile (module.js:588:28)
>     at Object.Module._extensions..js (module.js:635:10)
>     at Module.load (module.js:545:32)
>     at tryModuleLoad (module.js:508:12)
>     at Function.Module._load (module.js:500:3) …
Run Code Online (Sandbox Code Playgroud)

javascript selenium-webdriver webdriver-io webdriver-io-v4

5
推荐指数
1
解决办法
2617
查看次数

将 chrome 更新到 100 后,浏览器在 CI 中崩溃。我在浏览器日志中看到错误 ERR_INSUFFICIENT_RESOURCES。我们正在使用 webdriverIO v6

将 chrome 更新到 100 后,在 CI 中运行测试时浏览器崩溃。我在浏览器 wdio 日志中看到错误 ERR_INSUFFICIENT_RESOURCES。我们正在使用 webdriverIO v6 和 docker。Selenoid 在 docker 容器内运行测试。如果在本地运行,测试运行良好。有什么建议来解决这个问题吗?

testing automation google-chrome webdriver-io-v4 cicd

5
推荐指数
1
解决办法
786
查看次数

参考错误:$ 未定义(WebdriverIO)

我在 WebdriverIO 和 mocha 的帮助下启动本机应用程序,但无法与设备通信,但能够启动应用程序但不能与元素交互。

android_app_test.js

const webdriverio = require('webdriverio');
const androidOptions = require('../../../helpers/caps').androidOptions;
const assert = require('chai').assert;

androidOptions.capabilities.appPackage = "com.google.android.calculator"
androidOptions.capabilities.appActivity = "com.android.calculator2.Calculator"

describe('Create Chrome web session', function () {
    
    let client;

    before(async function () {
        client = await webdriverio.remote(androidOptions)
    });

    after(async function () {
        await client.deleteSession();
    });

    it('should create and destroy Android browser session', async function () {
        const elem = await $('#digit_2')
        elem.waitForDisplayed(3000);

        await client.touchClick('digit_2');
    });
});
Run Code Online (Sandbox Code Playgroud)

配置文件

var Mocha = require('mocha'), fs = require('fs');

var mocha …
Run Code Online (Sandbox Code Playgroud)

javascript mocha.js webdriver-io appium-android webdriver-io-v4

2
推荐指数
1
解决办法
5251
查看次数

如何使用 webdriverIO js 和 mocha 处理 Iframe 内容

我希望能够单击“同意”按钮以同意网站上的 cookie,我知道如何在 selenium webdriver 中执行此操作,但是,我不知道如何使用 js 和 mocha 执行此操作,因为我正在尝试学习任何帮助表示赞赏。

我试过

browser.switchToFrame($('#sp_message_iframe_207015')); 
$(getHighlightedText('Agree')).click();
Run Code Online (Sandbox Code Playgroud)

但没有用

基本上,我启动该网站,然后收到一个弹出窗口,要求同意 cookie 并管理 cookie/首选项,我只想能够单击“同意”

#sp_message_iframe_207015是 Iframe 的 Id

同意元素看起来像这样

<button 
    tabindex="0" 
    title="Agree" 
    aria-label="Agree" 
    class="message-component message-button no-children" 
    path="[0,4,1]" 
    style="padding: 10px 50px; margin: 10px; border-width: 1px; border-color: rgb(0, 115, 197); border-radius: 20px; border-style: solid; font-size: 14px; font-weight: 600; color: rgb(255, 255, 255); font-family: &quot;trebuchet ms&quot;, helvetica, sans-serif; width: auto; background: rgb(0, 115, 197);"
>
    Agree
</button>
Run Code Online (Sandbox Code Playgroud)

javascript mocha.js webdriver-io webdriver-io-v4 mochawesome

1
推荐指数
1
解决办法
1万
查看次数