Struggling with Webdriverio 8 when trying to execute CTRL + Multiple clicks

For selecting multiple columns, I attempted to press the ctrl button using WebDriverIO - 8 and node 16. However, despite trying various methods such as using await browser.keys(Key.Control), ctrl functionality was not achieved.

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

I also experimented with different actions but have not had any success so far.

Answer №1

If you're looking for information on Webdriverio's performActions function, the documentation can be a bit lacking:

Here is a sample code snippet to demonstrate how to use performActions:

         await this.browser.performActions([{
            type: 'key',
            id: 'keyboard',
            actions: [{ type: 'keyDown', value: '\uE009' }],
          }]);

               ...simulate some mouse clicks

          await this.browser.performActions([{
            type: 'key',
            id: 'keyboard',
            actions: [{ type: 'keyUp', value: '\uE009' }],
          }]);

Answer №2

Finally, success! This method worked like a charm.

    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: "" }],
      },
    ]);
  });

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Utilizing AngularJS: Running a controller function within a directive

I'm brand new to AngularJS and I'm trying something new: I want to bind a scroll event to an element using a custom directive. Here's the code snippet: First, let's look at my controller: var officeUIApplication = angular.module(&apo ...

Utilizing JQuery to populate DIVs with JSON information

Hey! I recently received some helpful advice from a coding expert, and now I'm in the process of restructuring my code based on these recommendations: When using $.each(), you have the option to return true or false. If you return false, the loop wi ...

Positioned in the center of the screen is an IFrame that is centered inside a div

How can I center an iframe inside a div in the middle of the screen? I've tried adding margin: 0 auto to #iframe but it didn't work. What am I missing here? Any help would be appreciated. <head> <title></title> <li ...

Why is it that my website in React crashes when I type rapidly in the TextField component?

Whenever I input text quickly into the TextField in my app, it causes my website to crash and display a blank white screen. Below is the snippet of code causing the problem: TextField Code: <TextField label="Item name" ...

Avoiding overlapping handlers in VueJS

There seems to be an issue where a function is being called from mounted(), but when the elements are loaded, the same function is also called again, interrupting the first call and preventing it from completing the entire process. <b-table id=&qu ...

Executing a JavaScript function within a Vue component script

I'm working on a simple component file for submitting a form, along with a JavaScript function to handle an action: <template> <div> <div class="modal-header"> <button type="button" class="close" data-dismi ...

Utilizing URL Hashes to Integrate Isotope Filtering: A Comprehensive Guide

(Even though Wordpress is mentioned, I believe this problem is not specific to Wordpress) I am currently building my own website using Wordpress and the theme I'm using includes the Isotope by Metafizzy package. This package helps in filtering posts ...

Using radio buttons to toggle the visibility of a div element within a WordPress website

I am currently working on creating a WordPress page using the custom page tool in the admin interface. My goal is to have 3 radio buttons, with 2 visible and 1 hidden. The hidden button should be automatically checked to display the correct div (although ...

Making adjustments to a row in the free jqGrid is a breeze with the ability

Using free jqGrid 4.12.1, I aim to incorporate functionality for adding, editing, and deleting rows in the grid with server-side calls for each operation. Below is the implementation of editurl and 'actions' formatter, { name: "actions", wi ...

An unforeseen issue arose while trying to update the data in a Chart.js chart within a Vue application

I am currently utilizing Chart.js version 3.5 along with Vue 3. After successfully creating a chart, I attempted to trigger a data change within a Vue method. However, I encountered an issue that displayed the following error message: "Uncaught TypeError: ...

What is the best way to iterate through a JSON file?

Looking at my JSON file: { "stats": { "operators": { "recruit1": { "won": 100, "lost": 50, "timePlayed": 1000 }, "recruit2": { "won": 200, ...

Loading game resources in advance for future or immediate utilization

I'm currently developing a game UI that involves a large number of image files, totaling around 30MB in size. I've been caching these images to the disk using service workers, but some of them are quite large at 3MB each. Even when they are retri ...

Implementing a watcher property in JavaScript to dynamically add a class to an element

I'm currently facing an issue where I need to apply a class to an element when a certain data property changes. My approach involves using a watcher to monitor the value change and adding a class through JavaScript, as demonstrated in the code snippet ...

Tips for obscuring URLs in AngularJS code without relying on base 64 encoding or Gulp obfuscation techniques

I'm looking for a way to obfuscate specific URLs in my AngularJS code without using base 64 encoding. Is there a method to only obfuscate URLs? var app_data = { 'APP_CONFIG': { 'USER_URL': 'http://127.1.1.0:8000/ ...

Utilizing JSON for the setAttribute() method

While I've made progress on this issue, I've encountered numerous confusing methods. The goal is to utilize the key:value pairs in attr{} for the setAttribute() function without relying on any framework. If anyone could provide a straightforward ...

Is the loading speed of my GLTF files in ThreeJS too slow on the hosting server?

Currently, I am in the process of developing a website that features a 3D Market Place. Unfortunately, I am facing difficulties implementing the key feature of this site. You can view the alpha version of the website here: All the code is located in the ...

Extract the target from the loop in JavaScript and process it externally

I am looking to extract the values from a loop and manipulate them outside of it. Specifically, I want to target all elements with the class "testY" and only apply changes to the last one. let classes = Array.from(document.getElementsByClassName("testY") ...

The directive in Angular compels the webpage to carry out the added HTML attribute

There is a custom directive in my code that applies the spellcheck attribute to two div elements as shown below: (function(){ 'use strict'; app.directive('spellchecker', spellchecker); spellchecker.$inject = ['$timeout&a ...

Having trouble accessing a gtlf file in an HTML document using Three.js

My goal is to create an interactive and clickable 3D image that I downloaded from Sketchfab using Three.js. I have carefully followed the guidelines provided by ChatGPT and have all the necessary scripts in my folder (GLTFLoader.js, main.js, OrbitControls. ...

Is it recommended to use separate Controllers for each tab in Angular JS to load the pane?

Recently delving into the world of Angular JS and eagerly seeking expert advice and suggestions. Would it be advisable to use separate controllers for initializing each Tab to load the Pane content? Is assigning separate controllers a recommended approac ...