Skip to content

[🚫 Bug] TerminalView executeCommand() failing: Object not interactable #1494

Open
@andreriesco

Description

@andreriesco

Describe the bug

If on the .vscode/tasks.json there is a task that is executed when the workspace opens, with the following parameter:

            "runOptions": {
                "runOn": "folderOpen"
            },

Then, even after this task is finished, when running another task and trying to interact with the Terminal View (I am using terminalView.executeCommand('y', 5000)), then a ElementNotInteractableError: element not interactable error happens.

Code that I am executing:

    try {
        const terminalView = await new BottomBarPanel().openTerminalView();
        await terminalView.executeCommand('y', 5000);
    } catch (ex: any) {
        console.log(ex);
    }

Steps to reproduce

Try to run the `terminalView.executeCommand('y', 5000);` :

    try {
        const terminalView = await new BottomBarPanel().openTerminalView();
        await terminalView.executeCommand('y', 5000);
    } catch (ex: any) {
        console.log(ex);
    }

In a workspace that has a task with:

            "runOptions": {
                "runOn": "folderOpen"
            },

This is the task on my workspace:

        {
            "label": "create-venv",
            "detail": "",
            "hide": true,
            "command": "/usr/bin/python3",
            "type": "process",
            "args": [
                "-m",
                "venv",
                ".venv"
            ],
            "problemMatcher": "$msCompile",
            "icon": {
                "id": "vm",
                "color": "terminal.ansiCyan"
            },
            "runOptions": {
                "runOn": "folderOpen"
            },
            "presentation": {
                "echo": true,
                "reveal": "silent",
                "focus": false,
                "panel": "shared",
                "group": "python-related"
            }
        },

This also happens with this task, from a different project:

        {
            "label": "npm-install",
            "detail": "Install the node packages dependencies",
            "type": "shell",
            "command": "npm",
            "options": {
                "cwd": "${workspaceFolder}"
            },
            "args": [
                "install"
            ],
            "dependsOrder": "sequence",
            "runOptions": {
                "runOn": "folderOpen"
            },
            "icon": {
                "id": "desktop-download",
                "color": "terminal.ansiYellow"
            },
            "presentation": {
                "echo": true,
                "reveal": "always",
                "focus": true,
                "panel": "shared",
                "group": "build-execution"
            }
        },

Logs

ElementNotInteractableError: element not interactable
  (Session info: chrome=122.0.6261.156)
    at Object.throwDecodedError (/home/andreriesco/Documents/IDE2.0/apollox/apollox-vscode/node_modules/selenium-webdriver/lib/error.js:521:15)
    at parseHttpResponse (/home/andreriesco/Documents/IDE2.0/apollox/apollox-vscode/node_modules/selenium-webdriver/lib/http.js:514:13)
    at Executor.execute (/home/andreriesco/Documents/IDE2.0/apollox/apollox-vscode/node_modules/selenium-webdriver/lib/http.js:446:28)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Driver.execute (/home/andreriesco/Documents/IDE2.0/apollox/apollox-vscode/node_modules/selenium-webdriver/lib/webdriver.js:742:17)
    at async TerminalView.executeCommand (/home/andreriesco/Documents/IDE2.0/apollox/apollox-vscode/node_modules/@redhat-developer/page-objects/out/components/bottomBar/Views.js:111:9)
    at async terminalConsoleExecuteCommand (/home/andreriesco/Documents/IDE2.0/apollox/apollox-vscode/out/tests/utils/Utils.js:300:9)
    at async checkDeps (/home/andreriesco/Documents/IDE2.0/apollox/apollox-vscode/out/tests/utils/ProjectUtils.js:471:13)
    at async Context.<anonymous> (/home/andreriesco/Documents/IDE2.0/apollox/apollox-vscode/out/tests/004NewProjectsFromTemplate.test.js:79:17) {
  remoteStacktrace: '#0 0x5df22620df33 <unknown>\n' +
    '#1 0x5df225f05b37 <unknown>\n' +
    '#2 0x5df225f4af4f <unknown>\n' +
    '#3 0x5df225f49390 <unknown>\n' +
    '#4 0x5df225f72eb2 <unknown>\n' +
    '#5 0x5df225f456b8 <unknown>\n' +
    '#6 0x5df225f7307e <unknown>\n' +
    '#7 0x5df225f91899 <unknown>\n' +
    '#8 0x5df225f72c53 <unknown>\n' +
    '#9 0x5df225f43db3 <unknown>\n' +
    '#10 0x5df225f4477e <unknown>\n' +
    '#11 0x5df2261d386b <unknown>\n' +
    '#12 0x5df2261d7885 <unknown>\n' +
    '#13 0x5df2261c1181 <unknown>\n' +
    '#14 0x5df2261d8412 <unknown>\n' +
    '#15 0x5df2261a525f <unknown>\n' +
    '#16 0x5df2261fc528 <unknown>\n' +
    '#17 0x5df2261fc723 <unknown>\n' +
    '#18 0x5df22620d0e4 <unknown>\n' +
    '#19 0x786280c94ac3 <unknown>\n'
}

Operating System

Ubuntu 22.04

Visual Studio Code

1.91.1 and 1.92.2

vscode-extension-tester

8.6.0

NodeJS

18.19.1

npm

10.2.4

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    Status

    Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions