Having trouble implementing highlighting functionality for a WebElement in Selenium with JavascriptExecutor on Firefox version 35

During the execution of a script designed to highlight and reset a WebElement in selenium 2.43:

public void highlightElement(WebElement element) {
  String originalStyle = element.getAttribute("style");
  JavascriptExecutor js = (JavascriptExecutor) selenium;
  js.executeScript("arguments[0].setAttribute('style', arguments[1]);",element,
                "color: red; border: 5px solid red;");
  try {
    Thread.sleep(3000);
  } catch (InterruptedException e) {}
  js.executeScript("arguments[0].setAttribute('style', '" + originalStyle + "');", element);
}

An error is thrown by Eclipse:

org.openqa.selenium.WebDriverException: arguments[0] is undefined
Command duration or timeout: 74 milliseconds
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{platform=WINDOWS, databaseEnabled=true, cssSelectorsEnabled=true, javascriptEnabled=true, acceptSslCerts=true, handlesAlerts=true, browserName=firefox, webStorageEnabled=true, nativeEvents=false, rotatable=false, locationContextEnabled=true, applicationCacheEnabled=true, takesScreenshot=true, version=35.0}]

The issue started after updating to Firefox 35. Is there any workaround available?

Answer №1

When I was using firefox 35, I encountered the same problem. I decided to switch back to firefox 33, and that fixed it for me. ()

By using Selenium server version 2.44.0 with firefox 33, the issue was resolved successfully.

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

Button triggered page refresh after Ajax content load

After using AJAX to load a page into a div, everything seems to be working as expected. However, I'm encountering an issue where clicking on buttons within the loaded content causes the entire page to refresh unexpectedly. This behavior is inconsisten ...

What steps should I take to ensure that clicking this button triggers the API request and returns the data in JSON format?

I'm attempting to have the button with id 'testp' return an api request in json format, however it seems to not be functioning properly. You can find the HTML code link here: https://github.com/atullu1234/REST-API-Developer-1/blob/main/js-bu ...

Adding a custom source to the script tag in Angular 7

I am currently using angular cli to develop my web application. The app is being built in the dist folder as of now. This is the index.html file: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>Adm ...

Is it possible to pass the image source to a Vue.js component through a

I am encountering an issue while trying to display an image in the designated location within display.vue. Even though {{ someText }} returns the correct file path (../assets/city.png), the image is not being output correctly. Here is how my code looks: ...

Labeling with the index number of arrays

var arr = []; $('.inp').click(function(){ function arrcall() { $.each(arr, function(key, value) { alert('Array Key is: ' + key + ' \n Array Key value is: ' + value); }); } ...

NextJs Link component does not refresh scripts

While using the <Link> tag in NextJs for page navigation, I encountered an issue where my scripts do not rerun after switching pages. The scripts only run on the initial page load or when I manually reload the page. This behavior is different when us ...

Can you provide the name of the slideshow plugin used on the Wipro website?

Can anyone tell me the name of the image slide show featured on: http://www.wipro.com/index.htm? Also, does anyone know where I can find the script for free? I am looking to incorporate it into a page that is coded in php, html, css, and javascript. Than ...

Efficient page navigation bar that doesn't clutter the layout

I'm facing an issue with my navbar setup. I want it to stay at the top of the page without being sticky. However, the presence of the navbar is causing a scroll to appear on my page. This happens because: The navbar takes up space I sometimes use tri ...

Develop a new entity utilizing Array in Javascript

let DaysArray: any = ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"] I am looking to transform the above array into an Object structure as shown below: let DaysObject: any = { time: { headerName: "" }, m ...

Share the hyperlink to a webpage with someone else

In my SQL command, I have a unique feature that retrieves the complete URL value of the current page: [##cms.request.rawurl##]. This code returns the entire URL. I need to send this address to another page and load it into a special div called "load-fac". ...

Switch between class and slider photos

I am currently having an issue toggling the class. Here is the code I am working with: http://jsfiddle.net/h1x52v5b/2/ The problem arises when trying to remove a class from the first child of Ul. I initially set it up like this: var len=titles.length, ...

The React Native app mysteriously crashes repeatedly without generating any error logs when using the same component multiple

Currently, I am developing in React Native app Version 0.70. Encountering a peculiar issue where the React Native app crashes without any error logs in the console. Below is the snippet of my code where most crashes seem to happen: import { ...

develop a customizable component library similar to shadcn for easy installation

Currently in the process of developing a design system, I am looking for advice on creating an installable library similar to shadcn. It is important to me that the source code of the components can be easily accessed and modified within my project. Is t ...

Is it possible to create a looped GLTF animation in three.js using random time intervals?

I am currently exploring the world of game development with Three.js and have a specific query regarding animating a GLTF model. Is it possible to animate the model at random intervals instead of in a continuous loop? In the game I am creating, players wil ...

Using Socket.io with Heroku

I encountered an issue with using Node.js and socket.io on Heroku. While it works without any problems on my local environment, once I deploy it to Heroku and try to access the website, it shows me an application error page. Even after checking the logs, I ...

I'm puzzled as to why I'm initially seeing a mass of HTML code instead of clickable href links. However, following that initial confusion, I am relieved to find a neat and organized

` from selenium import webdriver from bs4 import BeautifulSoup as bs import re class CarScraper: def __init__(self): self.driver = webdriver.Chrome(r'C:\Users\gkhat\Downloads\chromedriver.exe') self. ...

JavaScript - issue with event relatedTarget not functioning properly when using onClick

I encountered an issue while using event.relatedTarget for onClick events, as it gives an error, but surprisingly works fine for onMouseout. Below is the code snippet causing the problem: <html> <head> <style type="text/css"> ...

What does the error message "unsupported command-line flag" in Chrome mean for Protractor?

Recently jumping on the Protractor bandwagon, I found myself facing an issue while running my tests on Chrome (an error message appears below the address bar in the browser): A worrisome warning popped up saying something about '--ignore-certificat ...

Retrieve information from a sensor within an Express server and display it on the user interface

Looking for suggestions on resolving a challenge: I have a Node.js module that retrieves data from a sensor, and I am interested in incorporating a UI element to showcase the sensor data (either in real-time or pseudo-realtime). Is there a way to establ ...

Confused about how to utilize the variable `${PORT}`?

Currently, I am following a tutorial in which the instructor inputs the following code snippet: let PORT = process.env.PORT || 3000; app.listen(PORT, () => { console.log('Server beating ...