The Protractor actions().mouseMove function does not seem to function properly in Firefox and IE, although it works perfectly in Chrome

I've encountered an issue with the mouseMove command while using the actions class. The error occurs specifically when running the script on Firefox and IE, but works fine on Chrome.

Below is the code snippet I attempted:

browser.get("https://chercher.tech/practice/popups")
        // mouse hover on a submenu
        browser.actions().mouseMove(element(by.id("sub-menu"))).perform()

Appreciate any help in advance :)

Answer №1

For years, the 'action' functions in Gecko driver have been buggy. Numerous issues are open on Github regarding this. In the meantime, you can utilize this package (which also includes mouseMove functionality): https://www.npmjs.com/package/protractor-firefox-support

The frustrating aspect is that you may end up duplicating all your spec files when using mouse actions for Firefox... Perhaps someone will create an innovative solution to automatically detect the browser or adjust based on capabilities.

Answer №2

Consider utilizing:

await browser.executeScript('arguments[0].scrollIntoView(true)', avatarButton);

Make sure to replace avatarButton with the appropriate selector

Answer №3

To trigger an event, you can utilize dispatchEvent in Chrome and Firefox.

it('verifies the tooltip on the button with the ID of myFirstButton', async() => {
    const button = await element(by.id('myFirstButton'));
    await browser.executeScript(`var ev = new MouseEvent('mouseenter');`
                                + 'arguments[0].dispatchEvent(ev);', button);
    /* The tooltip should now be displayed ... */
    ...
});

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

The battle of promises versus async await in Koa middleware

In an attempt to create a Koa middleware, I am faced with the decision of how to proceed based on certain conditions. If the condition is met, I want to move on to the next middleware. If it is not met, I need to stop the flow. Two possible approaches invo ...

Struggling to reflect changes in the database using the updated value in the localStorage

I have a table where the td is set to contenteditable. To update the value of the td in my database, I decided to use localStorage. When the save button is clicked, the inputted value in the td will be saved to localStorage and retrieved via AJAX to replac ...

Utilizing Express middleware to serve routes in Sails.js

I am currently working on a sails app where the routes and static assets are served from the root location, which is functioning properly. However, I am looking to integrate an express middleware to serve these routes and assets from a specific path. To s ...

Error encountered when attempting to initiate a second screenshare on Chrome due to an invalid state

I am interested in utilizing Screensharing in Chrome. After following a guide and creating an extension to access the deviceId for getUserMedia, I was able to successfully start streaming my screen. However, when I attempted to stop the stream using the pr ...

Guide on viewing chromedriver logs during Protractor testing

I've recently discovered that chromedriver has the ability to generate a logfile (https://sites.google.com/a/chromium.org/chromedriver/logging) While the process of setting up this feature when running the executable directly is clear: chromedriver. ...

Experiencing problems with the response from the Netlify Lambda function.. consistently receiving undefined results

I've been working on setting up a lambda function to handle authentication, validation, and sending of a contact form. As I'm new to lambda functions, my code might have some flaws. However, despite my efforts, I am struggling to modify the resp ...

Ways of accessing an array within an if statement

I have a dashboard with admin privileges for my application. In this dashboard, the admin can select a user from a dropdown list. Once a user is selected, I make an AJAX call to retrieve the user's data and store it in a variable named $result. Howeve ...

Tips for assigning data from an AJAX response to a variable

Using jQuery and the code provided, there seems to be an issue with variable scope when some_condition is false. The error "items is not defined" indicates this problem. The goal is to set the result variable to the AJAX response data in order to use it o ...

Solving the issue of overflowing in the animation on scroll library

I've recently started using a fantastic library called animation on scroll (aos) for my web development projects. This library offers stunning and visually appealing animations. However, I encountered an issue where it causes overflow problems in my H ...

Tips for sending key combinations such as Command C using Selenium and Python

Is there a way to automate Command C and Command V using selenium in Python? I want the script to open a page, press Command L to select all, Command C to copy, and then Command V to paste it elsewhere. I've tried ActionChains and driver.sendKeys meth ...

Inverted Scrolling Problem in Firefox

I am facing an issue with a script that inverts mouse movement for horizontal scrolling. It works fine in most browsers except Firefox. I could use some advice on how to troubleshoot this problem! $("body").mousewheel(function(event, delta) { ...

What steps do I need to take to begin posting on NodeJS?

I am having issues creating a sample API for restaurants using the POST method. Despite launching the API and testing it in Postman, I'm not seeing any results. router.js const express = require('express'); const restaurantController = requ ...

JavaScript now assigns a value of null in place of undefined

When working with JavaScript, it's important to understand that undefined can be reassigned. Because of this, it is recommended to create a self-executing function to ensure that undefined remains undefined. Are there any other values that are loosely ...

Steps for automatically closing a TextPrompt if the end user does not respond within a specific time frame

How can I programmatically close a Prompt in Microsoft Chatbot SDK v4, such as TextPrompt or ConfirmPrompt, and end the dialog after a certain period of time if the user does not reply? I attempted to use setTimeout and step.endDialog but encountered issu ...

Material UI Date-Picker: Placeholder for Month Abbreviation with 3 Letters set as "MMMM" instead of the usual "MMM"

I'm currently using the most recent version of @mui/x-date-pickers (6.16.0). In my code snippet below, I have set the format of the text field input to be in "MMM DD, YYYY" style. However, when the date picker field is empty, the placeholder text disp ...

Maven is unable to locate the symbol with the specified class name: ProxyServer-browsermob

To incorporate proxy browsermob with Selenide and Selenium, I followed an example from a tutorial found at this link. Initially, I successfully ran the code using Eclipse. However, when attempting to run it using Maven, I encountered the following error: ...

Managing Numerous Dropdown Menus: Techniques and Tips

I'm currently working with MUI to design a navigation menu that contains dropdowns within certain links. However, I've encountered an issue where clicking on any button opens the same dropdown menu. Below is my code snippet: function Header() { ...

Saving the initial and final days of each month in a year using javascript

I am trying to create an array of objects that contain the first and last day of each month in the year. I have attempted a solution but have hit a roadblock and cannot achieve the desired results. module.exports = function () { let months_names = ["j ...

Expanding the MatBottomSheet's Width: A Guide

The CSS provided above is specifically for increasing the height of an element, but not its width: .mat-bottom-sheet-container { min-height: 100vh; min-width: 100vw; margin-top: 80px; } Does anyone have a solution for expanding the width of MatBott ...

Unable to select the button | Automating WordPress with Selenium using Python 2.7

Currently working with Selenium Web Driver using Python, I've encountered an issue where I am unable to click on a particular button. This button happens to be the browse button found in WordPress File Uploads. To address this problem, I have create ...