Home  >  Q&A  >  body text

Webdriverio 8: Unable to perform CTRL + multiple clicks

I have several columns and I need to press the ctrl button and then select multiple columns. I tried many ways but ctrl doesn't execute.

await browser.keys(Key.Control);
    await campaignNameColumn.click();
    await browser.keys(Key.Control);
    await monthColumn.click();

Also tried perfromaactions, but no success yet. I'm using WDIO - 8 and node 16

P粉763748806P粉763748806197 days ago1516

reply all(1)I'll reply

  • P粉386318086

    P粉3863180862024-04-06 00:24:53

    Finally this worked for me.

    await browser.performActions([
            {
              type: "key",
              id: "keyboard",
              actions: [{ type: "keyDown", value: "" }],
            },
          ]);
        await campaignNameColumn.click();
        await monthColumn.click();
        await browser.performActions([
          {
            type: "key",
            id: "keyboard",
            actions: [{ type: "keyUp", value: "" }],
          },
        ]);
      });

    reply
    0
  • Cancelreply