Problem in waitFor function using selenium/standalone-chrome and webdriverio #8433 - async-await

I'm facing issues using selenium/standalone-chrome, webdriverio and cucumber.
When waiting for an element to be present the webdriver does not find the element (Note: When viewing in assisted mode I can see that the element is present.)
what have i already tried? Here:
waitForExist
waitForDisplayed
waitForEnabled
Increase the connectionRetryTimeout
tested another css and xpath selector
update dependencies for the last version
update selenium/standalone-chrome for the last version
Note: In headless mode this problem does not happen
`
[2022-06-15T06:02:17.909Z] [0-0] 2022-06-15T06:02:17.871Z INFO webdriver: [POST] http://chrome:4444/wd/hub/session/5c967e4c3021be59481b42c571ea1788/element/ccab9b22-7bbf-42b1-9deb-3567e210d370/click [2022-06-15T06:02:18.172Z] [0-0] 2022-06-15T06:02:17.924Z INFO webdriver: COMMAND findElement("css selector", ".navbar.navbar-fixed-top") [2022-06-15T06:02:18.172Z] [0-0] 2022-06-15T06:02:17.924Z INFO webdriver: [POST] http://chrome:4444/wd/hub/session/5c967e4c3021be59481b42c571ea1788/element [2022-06-15T06:02:18.172Z] [0-0] 2022-06-15T06:02:17.924Z INFO webdriver: DATA { using: 'css selector', value: '.navbar.navbar-fixed-top' } [2022-06-15T06:02:18.172Z] [0-0] 2022-06-15T06:02:17.940Z INFO webdriver: RESULT { [2022-06-15T06:02:18.172Z] [0-0] error: 'no such element', [2022-06-15T06:02:18.172Z] [0-0] message: 'no such element: Unable to locate element: {"method":"css selector","selector":".navbar.navbar-fixed-top"}\n' + [2022-06-15T06:02:18.172Z] [0-0] ' (Session info: chrome=101.0.4951.41)', [2022-06-15T06:02:18.172Z] [0-0] stacktrace: '#0 0x55bc6123c533 \n' + [2022-06-15T06:02:18.172Z] [0-0] '#1 0x55bc60f9b1e8 \n' + [2022-06-15T06:02:18.172Z] [0-0] '#2 0x55bc60fd12d7 \n' + [2022-06-15T06:02:18.172Z] [0-0] '#3 0x55bc60fd14a1 \n' + [2022-06-15T06:02:18.173Z] [0-0] '#4 0x55bc61004494 \n' + [2022-06-15T06:02:18.173Z] [0-0] '#5 0x55bc60feef6d \n' + [2022-06-15T06:02:18.173Z] [0-0] '#6 0x55bc61002224 \n' + [2022-06-15T06:02:18.173Z] [0-0] '#7 0x55bc60feee33 \n' + [2022-06-15T06:02:18.173Z] [0-0] '#8 0x55bc60fc471a \n' + [2022-06-15T06:02:18.173Z] [0-0] '#9 0x55bc60fc5875 \n' + [2022-06-15T06:02:18.173Z] [0-0] '#10 0x55bc61280e1d \n' + [2022-06-15T06:02:18.173Z] [0-0] '#11 0x55bc61284751 \n' + [2022-06-15T06:02:18.173Z] [0-0] '#12 0x55bc6126b07e \n' + [2022-06-15T06:02:18.173Z] [0-0] '#13 0x55bc61285388 \n' + [2022-06-15T06:02:18.173Z] [0-0] '#14 0x55bc6125ffe0 \n' + [2022-06-15T06:02:18.173Z] [0-0] '#15 0x55bc612a1748 \n' + [2022-06-15T06:02:18.173Z] [0-0] '#16 0x55bc612a18c8 \n' + [2022-06-15T06:02:18.173Z] [0-0] '#17 0x55bc612bb70d \n' + [2022-06-15T06:02:18.173Z] [0-0] '#18 0x7f1110127609 \n' [2022-06-15T06:02:18.173Z] [0-0] } [2022-06-15T06:02:18.173Z] [0-0] 2022-06-15T06:02:17.941Z INFO webdriver: COMMAND findElements("css selector", ".navbar.navbar-fixed-top") [2022-06-15T06:02:18.173Z] [0-0] 2022-06-15T06:02:17.941Z INFO webdriver: [POST] http://chrome:4444/wd/hub/session/5c967e4c3021be59481b42c571ea1788/elements [2022-06-15T06:02:18.173Z] [0-0] 2022-06-15T06:02:17.941Z INFO webdriver: DATA { using: 'css selector', value: '.navbar.navbar-fixed-top' } [2022-06-15T06:02:18.173Z] [0-0] 2022-06-15T06:02:17.956Z INFO webdriver: RESULT [] [2022-06-15T06:02:18.758Z] [0-0] 2022-06-15T06:02:18.442Z INFO webdriver: COMMAND findElements("css selector", ".navbar.navbar-fixed-top") [2022-06-15T06:02:18.758Z] [0-0] 2022-06-15T06:02:18.443Z INFO webdriver: [POST] http://chrome:4444/wd/hub/session/5c967e4c3021be59481b42c571ea1788/elements [2022-06-15T06:02:18.758Z] [0-0] 2022-06-15T06:02:18.443Z INFO webdriver: DATA { using: 'css selector', value: '.navbar.navbar-fixed-top' } [2022-06-15T06:02:28.785Z] [0-0] 2022-06-15T06:02:28.446Z WARN webdriver: Request timed out! Consider increasing the "connectionRetryTimeout" option. [2022-06-15T06:02:28.785Z] [0-0] 2022-06-15T06:02:28.446Z INFO webdriver: Retrying 1/3 [2022-06-15T06:02:28.785Z] [0-0] 2022-06-15T06:02:28.446Z INFO webdriver: [POST] http://chrome:4444/wd/hub/session/5c967e4c3021be59481b42c571ea1788/elements [2022-06-15T06:02:28.785Z] [0-0] 2022-06-15T06:02:28.446Z INFO webdriver: DATA { using: 'css selector', value: '.navbar.navbar-fixed-top' } [2022-06-15T06:02:38.813Z] [0-0] Error in "0: Given the user is in Explore" [2022-06-15T06:02:38.813Z] Error: element (".navbar.navbar-fixed-top") still not existing after 20000ms [2022-06-15T06:02:38.813Z] at async login (/app/features/step-definitions/given.js:20:5) [2022-06-15T06:02:38.813Z] at async CustomWorld. (/app/features/step-definitions/given.js:11:5) [2022-06-15T06:02:38.813Z] [0-0] 2022-06-15T06:02:37.954Z INFO webdriver: COMMAND deleteSession() [2022-06-15T06:02:38.813Z] [0-0] 2022-06-15T06:02:37.955Z INFO webdriver: [DELETE] http://chrome:4444/wd/hub/session/5c967e4c3021be59481b42c571ea1788 [2022-06-15T06:02:38.814Z] [0-0] 2022-06-15T06:02:38.448Z WARN webdriver: Request timed out! Consider increasing the "connectionRetryTimeout" option. [2022-06-15T06:02:38.814Z] [0-0] 2022-06-15T06:02:38.448Z INFO webdriver: Retrying 2/3 [2022-06-15T06:02:38.814Z] [0-0] 2022-06-15T06:02:38.449Z INFO webdriver: [POST] http://chrome:4444/wd/hub/session/5c967e4c3021be59481b42c571ea1788/elements [2022-06-15T06:02:38.814Z] [0-0] 2022-06-15T06:02:38.449Z INFO webdriver: DATA { using: 'css selector', value: '.navbar.navbar-fixed-top' } [2022-06-15T06:02:48.840Z] [0-0] 2022-06-15T06:02:47.962Z WARN webdriver: Request timed out! Consider increasing the "connectionRetryTimeout" option. [2022-06-15T06:02:48.840Z] [0-0] 2022-06-15T06:02:47.962Z INFO webdriver: Retrying 1/3 [2022-06-15T06:02:48.840Z] [0-0] 2022-06-15T06:02:47.962Z INFO webdriver: [DELETE] http://chrome:4444/wd/hub/session/5c967e4c3021be59481b42c571ea1788 [2022-06-15T06:02:48.841Z] [0-0] 2022-06-15T06:02:48.450Z WARN webdriver: Request timed out! Consider increasing the "connectionRetryTimeout" option. [2022-06-15T06:02:48.841Z] [0-0] 2022-06-15T06:02:48.450Z INFO webdriver: Retrying 3/3 [2022-06-15T06:02:48.841Z] [0-0] 2022-06-15T06:02:48.451Z INFO webdriver: [POST] http://chrome:4444/wd/hub/session/5c967e4c3021be59481b42c571ea1788/elements [2022-06-15T06:02:48.841Z] [0-0] 2022-06-15T06:02:48.451Z INFO webdriver: DATA { using: 'css selector', value: '.navbar.navbar-fixed-top' } [2022-06-15T06:02:58.867Z] [0-0] 2022-06-15T06:02:57.972Z WARN webdriver: Request timed out! Consider increasing the "connectionRetryTimeout" option. [2022-06-15T06:02:58.867Z] [0-0] 2022-06-15T06:02:57.972Z INFO webdriver: Retrying 2/3 [2022-06-15T06:02:58.867Z] [0-0] 2022-06-15T06:02:57.972Z INFO webdriver: [DELETE] http://chrome:4444/wd/hub/session/5c967e4c3021be59481b42c571ea1788 [2022-06-15T06:02:58.868Z] [0-0] 2022-06-15T06:02:58.453Z ERROR webdriver: Request failed with status undefined due to TimeoutError: Timeout awaiting 'request' for 10000ms when running "elements" with method "POST" and args "{"using":"css selector","value":".navbar.navbar-fixed-top"}" [2022-06-15T06:03:08.923Z] [0-0] 2022-06-15T06:03:07.981Z WARN webdriver: Request timed out! Consider increasing the "connectionRetryTimeout" option. [2022-06-15T06:03:08.923Z] [0-0] 2022-06-15T06:03:07.981Z INFO webdriver: Retrying 3/3 [2022-06-15T06:03:08.923Z] [0-0] 2022-06-15T06:03:07.981Z INFO webdriver: [DELETE] http://chrome:4444/wd/hub/session/5c967e4c3021be59481b42c571ea1788 [2022-06-15T06:03:18.950Z] [0-0] 2022-06-15T06:03:17.989Z ERROR webdriver: Request failed with status undefined due to TimeoutError: Timeout awaiting 'request' for 10000ms when running "http://chrome:4444/wd/hub/session/5c967e4c3021be59481b42c571ea1788" with method "DELETE" [2022-06-15T06:03:18.950Z] [0-0] 2022-06-15T06:03:17.989Z WARN webdriverio: Suppressing error closing the session: TimeoutError: Timeout awaiting 'request' for 10000ms when running "http://chrome:4444/wd/hub/session/5c967e4c3021be59481b42c571ea1788" with method "DELETE" [2022-06-15T06:03:18.950Z] [0-0] at getTimeoutError (/app/node_modules/webdriver/build/utils.js:320:24) [2022-06-15T06:03:18.950Z] [0-0] at NodeJSRequest._request (/app/node_modules/webdriver/build/request/index.js:154:59) [2022-06-15T06:03:18.950Z] [0-0] at processTicksAndRejections (node:internal/process/task_queues:96:5) [2022-06-15T06:03:18.950Z] [0-0] at async Browser.wrapCommandFn (/app/node_modules/#wdio/utils/build/shim.js:137:29) [2022-06-15T06:03:18.950Z] [0-0] at async Browser.reloadSession (/app/node_modules/webdriverio/build/commands/browser/reloadSession.js:36:9) [2022-06-15T06:03:18.950Z] [0-0] at async Browser.wrapCommandFn (/app/node_modules/#wdio/utils/build/shim.js:137:29) [2022-06-15T06:03:18.950Z] [0-0] at async Object.afterScenario (/app/wdio.conf.js:458:13) [2022-06-15T06:03:18.950Z] [0-0] at async Promise.all (index 0) [2022-06-15T06:03:18.950Z] [0-0] at async executeHooksWithArgsShim (/app/node_modules/#wdio/utils/build/shim.js:107:20) [2022-06-15T06:03:18.950Z] [0-0] at async CustomWorld.wdioHookAfterScenario (/app/node_modules/#wdio/cucumber-framework/build/index.js:256:13) [2022-06-15T06:03:18.950Z] [0-0] 2022-06-15T06:03:17.990Z INFO webdriver: [POST] http://chrome:4444/wd/hub/session [2022-06-15T06:03:18.950Z] [0-0] 2022-06-15T06:03:17.990Z INFO webdriver: DATA { [2022-06-15T06:03:18.950Z] [0-0] capabilities: { [2022-06-15T06:03:18.951Z] [0-0] alwaysMatch: { [2022-06-15T06:03:18.951Z] [0-0] browserName: 'chrome', [2022-06-15T06:03:18.951Z] [0-0] acceptInsecureCerts: true, [2022-06-15T06:03:18.951Z] [0-0] 'goog:chromeOptions': [Object] [2022-06-15T06:03:18.951Z] [0-0] }, [2022-06-15T06:03:18.951Z] [0-0] firstMatch: [ {} ] [2022-06-15T06:03:18.951Z] [0-0] }, [2022-06-15T06:03:18.951Z] [0-0] desiredCapabilities: { [2022-06-15T06:03:18.951Z] [0-0] browserName: 'chrome', [2022-06-15T06:03:18.951Z] [0-0] acceptInsecureCerts: true, [2022-06-15T06:03:18.951Z] [0-0] 'goog:chromeOptions': { args: [Array] } [2022-06-15T06:03:18.951Z] [0-0] } [2022-06-15T06:03:18.951Z] [0-0] } [2022-06-15T06:03:28.980Z] [0-0] 2022-06-15T06:03:27.998Z WARN webdriver: Request timed out! Consider increasing the "connectionRetryTimeout" option. [2022-06-15T06:03:28.980Z] [0-0] 2022-06-15T06:03:27.998Z INFO webdriver: Retrying 1/3 [2022-06-15T06:03:28.980Z] [0-0] 2022-06-15T06:03:27.999Z INFO webdriver: [POST] http://chrome:4444/wd/hub/session [2022-06-15T06:03:28.980Z] [0-0] 2022-06-15T06:03:27.999Z INFO webdriver: DATA { [2022-06-15T06:03:28.980Z] [0-0] capabilities: { [2022-06-15T06:03:28.980Z] [0-0] alwaysMatch: { [2022-06-15T06:03:28.980Z] [0-0] browserName: 'chrome', [2022-06-15T06:03:28.980Z] [0-0] acceptInsecureCerts: true, [2022-06-15T06:03:28.980Z] [0-0] 'goog:chromeOptions': [Object] [2022-06-15T06:03:28.980Z] [0-0] }, [2022-06-15T06:03:28.980Z] [0-0] firstMatch: [ {} ] [2022-06-15T06:03:28.980Z] [0-0] }, [2022-06-15T06:03:28.980Z] [0-0] desiredCapabilities: { [2022-06-15T06:03:28.980Z] [0-0] browserName: 'chrome', [2022-06-15T06:03:28.980Z] [0-0] acceptInsecureCerts: true, [2022-06-15T06:03:28.980Z] [0-0] 'goog:chromeOptions': { args: [Array] } [2022-06-15T06:03:28.980Z] [0-0] } [2022-06-15T06:03:28.980Z] [0-0] } [2022-06-15T06:03:39.008Z] [0-0] 2022-06-15T06:03:38.009Z WARN webdriver: Request timed out! Consider increasing the "connectionRetryTimeout" option. [2022-06-15T06:03:39.008Z] [0-0] 2022-06-15T06:03:38.009Z INFO webdriver: Retrying 2/3 [2022-06-15T06:03:39.008Z] [0-0] 2022-06-15T06:03:38.009Z INFO webdriver: [POST] http://chrome:4444/wd/hub/session [2022-06-15T06:03:39.008Z] [0-0] 2022-06-15T06:03:38.009Z INFO webdriver: DATA { [2022-06-15T06:03:39.008Z] [0-0] capabilities: { [2022-06-15T06:03:39.008Z] [0-0] alwaysMatch: { [2022-06-15T06:03:39.008Z] [0-0] browserName: 'chrome', [2022-06-15T06:03:39.008Z] [0-0] acceptInsecureCerts: true, [2022-06-15T06:03:39.008Z] [0-0] 'goog:chromeOptions': [Object] [2022-06-15T06:03:39.008Z] [0-0] }, [2022-06-15T06:03:39.009Z] [0-0] firstMatch: [ {} ] [2022-06-15T06:03:39.009Z] [0-0] }, [2022-06-15T06:03:39.009Z] [0-0] desiredCapabilities: { [2022-06-15T06:03:39.009Z] [0-0] browserName: 'chrome', [2022-06-15T06:03:39.009Z] [0-0] acceptInsecureCerts: true, [2022-06-15T06:03:39.009Z] [0-0] 'goog:chromeOptions': { args: [Array] } [2022-06-15T06:03:39.009Z] [0-0] } [2022-06-15T06:03:39.009Z] [0-0] } [2022-06-15T06:03:49.036Z] [0-0] 2022-06-15T06:03:48.017Z WARN webdriver: Request timed out! Consider increasing the "connectionRetryTimeout" option. [2022-06-15T06:03:49.036Z] [0-0] 2022-06-15T06:03:48.018Z INFO webdriver: Retrying 3/3 [2022-06-15T06:03:49.036Z] [0-0] 2022-06-15T06:03:48.018Z INFO webdriver: [POST] http://chrome:4444/wd/hub/session [2022-06-15T06:03:49.036Z] [0-0] 2022-06-15T06:03:48.018Z INFO webdriver: DATA { [2022-06-15T06:03:49.036Z] [0-0] capabilities: { [2022-06-15T06:03:49.036Z] [0-0] alwaysMatch: { [2022-06-15T06:03:49.036Z] [0-0] browserName: 'chrome', [2022-06-15T06:03:49.036Z] [0-0] acceptInsecureCerts: true, [2022-06-15T06:03:49.036Z] [0-0] 'goog:chromeOptions': [Object] [2022-06-15T06:03:49.036Z] [0-0] }, [2022-06-15T06:03:49.036Z] [0-0] firstMatch: [ {} ] [2022-06-15T06:03:49.036Z] [0-0] }, [2022-06-15T06:03:49.036Z] [0-0] desiredCapabilities: { [2022-06-15T06:03:49.036Z] [0-0] browserName: 'chrome', [2022-06-15T06:03:49.036Z] [0-0] acceptInsecureCerts: true, [2022-06-15T06:03:49.036Z] [0-0] 'goog:chromeOptions': { args: [Array] } [2022-06-15T06:03:49.036Z] [0-0] } [2022-06-15T06:03:49.036Z] [0-0] } [2022-06-15T06:03:59.073Z] [0-0] 2022-06-15T06:03:58.029Z ERROR webdriver: Request failed with status undefined due to TimeoutError: Timeout awaiting 'request' for 10000ms when running "http://chrome:4444/wd/hub/session" with method "POST" and args "{"capabilities":{"alwaysMatch":{"browserName":"chrome","acceptInsecureCerts":true,"goog:chromeOptions":{"args":["disable-infobars","disable-notifications","use-fake-ui-for-media-stream","window-size=1920,1080","host-resolver-rules=MAP cdn.pendo.io 127.0.0.1, MAP fullstory.com 127.0.0.1, MAP notify.bugsnag.com 127.0.0.1, MAP ssl.google-analytics.com 127.0.0.1","--disable-gpu"]}},"firstMatch":[{}]},"desiredCapabilities":{"browserName":"chrome","acceptInsecureCerts":true,"goog:chromeOptions":{"args":["disable-infobars","disable-notifications","use-fake-ui-for-media-stream","window-size=1920,1080","host-resolver-rules=MAP cdn.pendo.io 127.0.0.1, MAP fullstory.com 127.0.0.1, MAP notify.bugsnag.com 127.0.0.1, MAP ssl.google-analytics.com 127.0.0.1","--disable-gpu"]}}}" [2022-06-15T06:03:59.074Z] [0-0] 2022-06-15T06:03:58.029Z ERROR webdriver: TimeoutError: Timeout awaiting 'request' for 10000ms when running "http://chrome:4444/wd/hub/session" with method "POST" and args "{"capabilities":{"alwaysMatch":{"browserName":"chrome","acceptInsecureCerts":true,"goog:chromeOptions":{"args":["disable-infobars","disable-notifications","use-fake-ui-for-media-stream","window-size=1920,1080","host-resolver-rules=MAP cdn.pendo.io 127.0.0.1, MAP fullstory.com 127.0.0.1, MAP notify.bugsnag.com 127.0.0.1, MAP ssl.google-analytics.com 127.0.0.1","--disable-gpu"]}},"firstMatch":[{}]},"desiredCapabilities":{"browserName":"chrome","acceptInsecureCerts":true,"goog:chromeOptions":{"args":["disable-infobars","disable-notifications","use-fake-ui-for-media-stream","window-size=1920,1080","host-resolver-rules=MAP cdn.pendo.io 127.0.0.1, MAP fullstory.com 127.0.0.1, MAP notify.bugsnag.com 127.0.0.1, MAP ssl.google-analytics.com 127.0.0.1","--disable-gpu"]}}}"
dependencies:
"dependencies": {
"#wdio/cli": "7.19.7",
"#wdio/cucumber-framework": "7.19.7",
"#wdio/jasmine-framework": "7.19.7",
"#wdio/junit-reporter": "7.19.7",
"#wdio/local-runner": "7.19.7",
"#wdio/selenium-standalone-service": "7.19.5",
"aws-sdk": "2.1137.0",
"dotenv": "16.0.1",
"wdio-image-comparison-service": "3.1.1",
"webdriverio": "7.19.7"
},
"devDependencies": {
"#wdio/spec-reporter": "^7.16.13",
"eslint": "^8.8.0",
"eslint-config-standard": "17.0.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-jasmine": "4.1.3",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "6.0.0",
"eslint-plugin-standard": "5.0.0",
"eslint-plugin-wdio": "7.19.4",
"husky": "^8.0.1"
},
"husky": {
"hooks": {
"pre-commit": "yarn lint"
}
}
docker-compose:
services:
chrome:
image: selenium/standalone-chrome:4.1.4-20220427
shm_size: 4g
ports:
- "4444:4444"
- "7900:7900"
environment:
- SCREEN_WIDTH=1920
- SCREEN_HEIGHT=1080
- VNC_NO_PASSWORD=1
- VNC_VIEW_ONLY=1
page-object:
class Navbar {
get navbarElement() {
return $('.navbar.navbar-fixed-top');
}
code:
async function login() {
await LoginPage.open();
await LoginPage.login();
await (await NavbarModule.navbarElement).waitForExist({ timeout: 20000 });
}
```

Related

How to diagnose the slack bolt messaging 404 error

I am trying to launch a modal for my slack app. The modal has to be launched on click of a button from the base message section. I am using slack block builder ( https://www.blockbuilder.dev/) package to construct the json.
The bolt app has the following:
app.action('watch-skill-video', async ({ ack, action, client, say, respond }) => {
ack()
const msg = await watchLayoutBuilder('some value', 'someother value')
console.log('Message - ' + msg)
await respond(JSON.parse(msg))
});
I can see the message getting printed as -
{
"title": {
"type": "plain_text",
"text": "Abc"
},
"submit": {
"type": "plain_text",
"text": "Submit"
},
"blocks": [
{
"text": {
"type": "plain_text",
"text": "Dummy"
},
"type": "button"
}
],
"type": "modal"
}
However along with this, a 404 error is showing up in console ( and off course the popup does not work) !
[ERROR] bolt-app UnknownError: Request failed with status code 404
at asCodedError (/Users/rajeshghosh/Projects/pwa-slack/node_modules/#slack/bolt/dist/errors.js:35:12)
at App.handleError (/Users/rajeshghosh/Projects/pwa-slack/node_modules/#slack/bolt/dist/App.js:608:57)
at App.processEvent (/Users/rajeshghosh/Projects/pwa-slack/node_modules/#slack/bolt/dist/App.js:593:25)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async SocketModeClient.<anonymous> (/Users/rajeshghosh/Projects/pwa-slack/node_modules/#slack/bolt/dist/receivers/SocketModeReceiver.js:126:17) {
code: 'slack_bolt_unknown_error',
original: Error: Request failed with status code 404
at createError (/.../node_modules/#slack/bolt/node_modules/axios/lib/core/createError.js:16:15)
at settle (/.../node_modules/#slack/bolt/node_modules/axios/lib/core/settle.js:17:12)
at IncomingMessage.handleStreamEnd (/.../node_modules/#slack/bolt/node_modules/axios/lib/adapters/http.js:322:11)
at IncomingMessage.emit (events.js:412:35)
at IncomingMessage.emit (domain.js:475:12)
at endReadableNT (internal/streams/readable.js:1334:12)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
config: {
transitional: [Object],
adapter: [Function: httpAdapter],
transformRequest: [Array],
transformResponse: [Array],
timeout: 0,
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
maxBodyLength: -1,
validateStatus: [Function: validateStatus],
headers: [Object],
proxy: false,
method: 'post',
url: 'https://hooks.slack.com/actions/TFTS42ALT/3855892288214/7lmakyKKBAvk0paJguVzxoih',
data: '{"title":{"type":"plain_text","text":"Abc"},"submit":{"type":"plain_text","text":"Submit"},"blocks":[{"text":{"type":"plain_text","text":"Dummy"},"type":"button"}],"type":"modal"}'
},
request: ClientRequest {
_events: [Object: null prototype],
_eventsCount: 7,
_maxListeners: undefined,
outputData: [],
outputSize: 0,
writable: true,
destroyed: false,
_last: true,
chunkedEncoding: false,
shouldKeepAlive: false,
_defaultKeepAlive: true,
useChunkedEncodingByDefault: true,
sendDate: false,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
_contentLength: null,
_hasBody: true,
_trailer: '',
finished: true,
_headerSent: true,
socket: [TLSSocket],
_header: 'POST /actions/TFTS42ALT/3855892288214/7lmakyKKBAvk0paJguVzxoih HTTP/1.1\r\n' +
'Accept: application/json, text/plain, */*\r\n' +
'Content-Type: application/json\r\n' +
'User-Agent: axios/0.26.1\r\n' +
'Content-Length: 179\r\n' +
'Host: hooks.slack.com\r\n' +
'Connection: close\r\n' +
'\r\n',
_keepAliveTimeout: 0,
_onPendingData: [Function: noopPendingOutput],
agent: [Agent],
socketPath: undefined,
method: 'POST',
maxHeaderSize: undefined,
insecureHTTPParser: undefined,
path: '/actions/TFTS42ALT/3855892288214/7lmakyKKBAvk0paJguVzxoih',
_ended: true,
res: [IncomingMessage],
aborted: false,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
reusedSocket: false,
host: 'hooks.slack.com',
protocol: 'https:',
_redirectable: [Writable],
[Symbol(kCapture)]: false,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: [Object: null prototype]
},
response: {
status: 404,
statusText: 'Not Found',
headers: [Object],
config: [Object],
request: [ClientRequest],
data: [Object]
},
isAxiosError: true,
toJSON: [Function: toJSON]
}
}
[ERROR] An unhandled error occurred while Bolt processed (type: block_actions, error: Error: Request failed with status code 404)
I am using webhooks. Appreciate any help here !
Btw, If I send a simple message instead of modal, it works fine.
Well it turns out that the json was not properly constructed for a Modal. When I took the json over to block kit builder it was complaining . I experimented by changing respond to say and it was able to show me the validation errors. Blocks in Modal need to have elements and then the input fields embedded.
So the original issue of receiving 404 from slack is addressed.
However I am experiencing another issue ( modal not rendering the pop-up ), for which I am opening a separate SOF thread.

Cypress-testrail-reporter not updating result

I am using https://www.npmjs.com/package/cypress-testrail-reporter (version 1.2.2), have everything setup in cypress.json, when executing the spec file through the CLI I can see that the run id is being created and I can see it in TestRail but the test case itself is not being updated in TestRail. I am getting this weird log:
at createError (/Users/xxxxx/xxxxx/xxxxx/node_modules/cypress-testrail-reporter/node_modules/axios/lib/core/createError.js:16:15)
at settle (/Users/xxxxx/xxxxx/xxxxx/node_modules/cypress-testrail-reporter/node_modules/axios/lib/core/settle.js:18:12)
at IncomingMessage.handleStreamEnd (/Users/xxxxx/xxxxx/xxxxx/node_modules/cypress-testrail-reporter/node_modules/axios/lib/adapters/http.js:202:11)
at IncomingMessage.emit (events.js:327:22)
at endReadableNT (internal/streams/readable.js:1327:12)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
{
config: {
adapter: [Function: httpAdapter],
transformRequest: { '0': [Function: transformRequest] },
transformResponse: { '0': [Function: transformResponse] },
timeout: 0,
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
validateStatus: [Function: validateStatus],
headers: {
Accept: 'application/json, text/plain, */*',
'Content-Type': 'application/json',
'User-Agent': 'axios/0.18.1',
'Content-Length': 76
},
method: 'post',
url: 'host/index.php?/api/v2/add_results_for_cases/undefined',
auth: { username: 'username', password: 'password' },
data: '{"results":[{"case_id":379,"status_id":1,"comment":"Execution time: 42ms"}]}'
},```

Socket hang up for chrome-aws-lambda with Lambda Runtime 10.x

I have below code
browser = await chromium.puppeteer.launch({
args: ['--no-sandbox', '--single-process', '--start-maximized', '--headless', '--window-size=1920,1080', '--disable-gpu','--disable-setuid-sandbox'],
executablePath: await chromium.executablePath,
headless: true,
devtools: false,
ignoreHTTPSErrors: true,
});
I am getting below error saying Socket hangup. How can I fix it to run puppeteer on lambda
enter c2021-02-23T18:10:22.895Z 09b30961-2493-4d86-83aa-f7d243f46a7c INFO Error in PDF generation ErrorEvent { target: WebSocket { _events: [Object: null prototype] { open: [Function], error: [Function] }, _eventsCount: 2, _maxListeners: undefined, _binaryType: 'nodebuffer', _closeCode: 1006, _closeFrameReceived: false, _closeFrameSent: false, _closeMessage: '', _closeTimer: null, _extensions: {}, _protocol: '', _readyState: 3, _receiver: null, _sender: null, _socket: null, _bufferedAmount: 0, _isServer: false, _redirects: 0, _url: 'ws://127.0.0.1:37077/devtools/browser/3a65ff8c-2cae-4e89-bc43-5c4c7a2e7abf', _req: null, [Symbol(kCapture)]: false }, type: 'error', message: 'socket hang up', error: Error: socket hang up at connResetException (internal/errors.js:609:14) at Socket.socketOnEnd (_http_client.js:458:23) at Socket.emit (events.js:326:22) at Socket.EventEmitter.emit (domain.js:483:12) at endReadableNT (_stream_readable.js:1241:12) at processTicksAndRejections (internal/process/task_queues.js:84:21) { code: 'ECONNRESET' }}ode here

Can't set chrome browser language by chromeoptions

I want to set chrome language to other using chromeOptions,then it doesn't work. Below is my configuration:
desiredCapabilities: {
browserName: ‘chrome’,
javascriptEnabled: true,
acceptSslCerts: true,
chromeOptions: {
args: [
‘--no-sandbox’,
‘start-fullscreen’,
‘--lang=fr’
//‘--headless’
]
}
Any ideas? Thanks in advance.
https://gist.github.com/DATADEER/51da97498c03c804d75f4b3828cedb8c
chromeOptions: {
prefs: {
intl: {accept_languages:"de-DE,de"}
},
args: ['headless'],
},

Test Export / Download file with protractor

i got a problem. Can someome help me !
i want to export file from export button in js page and download file to a directory in my project for testing. But i cant change download default_directory. when i run test, it was downloaded in /Downloads , not /resource/download/ directory.
How can i set download directory for protractor
This is my protractor-config.js
directConnect: true,
multiCapabilities: [
{
browserName: 'firefox',
acceptInsecureCerts: true,
'moz:firefoxOptions': {
args: ["--headless"]
},
prefs: {
'download': {
'prompt_for_download': false,
'default_directory': process.cwd() + "/resources/test/download",
'directory_upgrade': true
},
},
},
{
browserName: 'chrome',
acceptInsecureCerts: true,
chromeOptions: {
args: [
"--headless",
]
},
prefs: {
'download': {
'prompt_for_download': false,
'default_directory': process.cwd() + "/resources/test/download",
'directory_upgrade': true,
},
},
}
],
Try the below one,
capabilities: {
'browserName': 'chrome',
'chromeOptions': {
prefs: {
download: {
'prompt_for_download': false,
'directory_upgrade': true,
'default_directory': process.cwd() + '/resources/test/download' // change in this place
}
}
}
},
Hope it helps you

Resources