An error in JavaScript occurred when trying to hover the mouse using Robot Framework: The method "elementsFromPoint" is not allowed on ShadowRoot

When attempting to mouse hover on an element using Robot Framework's keyword Mouse Over, I encountered an error stating, "javascript error: Disallowed method "elementsFromPoint" on ShadowRoot.". Interestingly, other keywords such as Click Element work fine for the same element. However, the mouse hover action triggers the aforementioned error message. I am currently unsure of how to address this issue and would appreciate any guidance in resolving it.

Answer №1

After a recent SalesForce update, I encountered the same issue with tooltips appearing unexpectedly. My solution was to utilize a Try/Catch block and explore an alternative method.

My approach involved targeting the parent element of the tooltip-triggering element, clicking on it to focus, and using sendkeys TAB to activate the Tooltip.

By implementing the Try/Catch block, any future changes made by SalesForce can be easily accommodated without requiring further adjustments.

I experimented with various JavaScript solutions like arguments[0].focus() and arguments[0].fireEvent('onmouseover'), but none provided a workable fix.

It's worth mentioning that when running tests on a headless Chrome browser in Linux, mouse and click actions may not function as expected.

> Blockquote 

       try {
            actions.moveToElement(element, 5, 5).perform();
        } catch (Exception e) {

            //Alternative method to trigger 'i' help hover 
            WebElement parent = element.findElement(By.xpath(".."));
            click(parent);
        }
    

Answer №3

If you are using ChromeDriver version 90 or above, the dispatchEvent() method can be utilized in the following manner:

var jsExecutor = (IJavaScriptExecutor)driver;
jsExecutor.ExecuteScript("arguments[0].dispatchEvent(new MouseEvent('mouseover', {'bubbles': true }));", element);

Answer №4

Encountered a similar issue when trying to click on a button within Salesforce. Implemented a JavaScript workaround inspired by nobyk's suggestion and it has been effective so far.

JavascriptExecutor jsExecutor = (JavascriptExecutor) driver;
jsExecutor.executeScript("arguments[0].focus(); arguments[0].click()", element);

Answer №5

An issue has been identified with the Chrome driver version 90 that is impacting certain actions class methods, such as moveToElement and dbclick, particularly when interacting with elements within shadow DOM parents.

To address this bug, it is recommended to downgrade to Chrome browser version 89 along with Chromium 89 to prevent automatic updates:

For Chromium 89: Chromium 89.0.4350.6

For ChromeDriver 89: ChromeDriver 89

Click here for more information on the defect tracking this issue.

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

Ways to initiate animation using CSS when the page loads

Is there a way to initialize the counter on page load? Even though I was successful in making it start on hover, I couldn't figure out how to make it work when the page loads. Here is the JavaScript code: var root = document.querySelector(':root ...

Error encountered when calling the function .jstree() on a tree structure

While working on MVC4, I attempted to implement a jstree but encountered an issue where the tree view was not displayed when running my application. Upon investigating with Firebug, I came across the following error message: "TypeError: $(...).jstree is ...

"MongoDB's .find function functions properly in the shell environment, but encounters issues when

As a newcomer to Node Express Mongo, I decided to venture into creating my own website after following tutorials. The page I'm working on is a login page. While other people's code has worked for me, my attempt didn't go as planned. Even con ...

JavaScript - turn off online connectivity

Is there a way to test my website for offline use by disabling connectivity on the bootstrap before anything loads, so that all data will be loaded from cache? I have tried various offline libraries such as this one, but I haven't found a way to prog ...

A comprehensive guide on how to find keywords within an array and then proceed to make all text within the parent div tag stand

I am currently looking for a webpage that displays a list of products based on keywords from an array. Once it detects any word in the array, it highlights it with a red background - everything is working smoothly so far. However, I now wish for the script ...

Retrieve the product IDs by selecting the checkboxes, then compile a fresh array consisting of the identified IDs

I am currently delving into the realm of typescript/angular2+ as a fledgling student, and I have taken on the task of creating a website to put my newfound knowledge to the test. The view is up and running, but I'm facing some roadblocks as I work on ...

Trouble accessing test results in Test Explorer on Visual Studio 2017

After writing this script on my work computer and seeing it run perfectly, I encountered issues trying to run it on my home computer. Despite having the exact version of Visual Studio installed, clicking build results in a successful build but doesn't ...

Converting JSON to Date in ES6/TS with Angular 2

Below is the JSON data: let JSON_RESPONSE = `{"birthDates": ["2017-01-02","2016-07-15"]}` There is a TypeScript object called Children with an array of Date objects and an ES6 constructor: class Children { birthDates: Date[] = [] constructor(values ...

Using `encodeURIComponent` to encode a URL does not function properly when used with a form action

After experimenting with the encodeURI function in conjunction with a form, I discovered an interesting behavior. I used encodeURI to encode a URL. <html> <head> </head> <body> <form id="form"> </form> <button id="bu ...

Exploring innovative CSS/Javascript techniques for creating intricate drawings

When using browsers other than Internet Explorer, the <canvas> element allows for advanced drawing. However, in IE, drawing with <div> elements can be slow for anything more than basic tasks. Is there a way to do basic drawing in IE 5+ using o ...

Steps to confirm if a particular cell within a table holds a specific value using Selenium and Python

There is a table in the format shown below: <tbody> <tr> <td>some text</td> <td>other text</td> <td> <a href="/process/100/">process data</a> or < ...

Using jQuery to eliminate any symbols from a text field

I am working on a text symbol removal function. However, I want to make sure that commas and periods ( . , ) are retained in the text field. Currently, the function is removing everything except digits. How can I modify it to keep the commas and dots int ...

What sets apart window.location.href from this.router.url?

I'm curious about the various methods of obtaining the current URL in Angular. For instance: this.router.url My main question is: What advantages does using this.router.url offer over simply using window.location? Could someone kindly provide an exp ...

Elevating the mesh causes the ray caster to perceive it as though it has been flipped along the Y-axis

My raycaster seems to be detecting all my objects but in a flipped manner. It works fine when I add a cube without changing its position, but as soon as I move the cube up, the ray-casting goes downwards. Does anyone have a solution for this issue? Curren ...

Navigating through the directories in PUG using the absolute path

Referring to the docs for PUG (), it states: If a path is absolute (example: include /root.pug), it gets resolved by prepending options.basedir. Otherwise, paths are resolved in relation to the file being compiled. To clarify, I understand that this in ...

Updating an array in AngularJS with Json and LocalStorage does not reflect the changes

I need to update the "color" property of an Array in a form within a View. The Array named colors consists of 5 objects that define the color of elements in another View. Since I cannot access the server, I plan to use localStorage for this task. The form ...

Which is more efficient: filtering a JSON object or querying the database using ajax?

I am currently developing a product page that involves a selection of options that will impact the pricing of the items. The primary option allows users to choose a material, which then influences the available set of options. Within the database, there i ...

Tips for implementing a switch-case statement with variable formats that may not always be

switch (req.path) { case "/api/posts": console.log("posts"); break; case "/api/posts/tags/*": // the part * is always changing depending on user input console.log("tags"); break; case "/api/best": console.log ...

Having trouble with Javascript Array Push and Splice not functioning properly?

My goal is to replace the value "3" with "4" in the array. After this operation, only "1":"2" will remain in the array. const array = []; array.push({ "1": "2" }) array.push({ "3": "4" }) const index = array.indexOf(3); if (index > -1) { array.sp ...

Tips for resolving the issue of data.map not being recognized as a function in the API

I am attempting to retrieve and display data from an API. Despite my efforts, I am unable to successfully showcase the data. PokemonSpecies.js import React from "react"; // import Loader from "./Loader"; import { Card, Col } from "react-bootstrap"; imp ...