Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7832225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T12:06:15+00:00 2026-06-02T12:06:15+00:00

I am using Selenium WebDriver and want to execute some javascript from a webpage.

  • 0

I am using Selenium WebDriver and want to execute some javascript from a webpage. I have found a fair few (very useful) posts on executing javascript and have had some success, though I seem to struggle when I have to call javascript from objects on the page (I am new to this so my terminology and basic understand may be off?). The following is the javascript on the page I want to call:

$j(".webGrid tr").hover(function () {
        $j(this).find("#imgEdit").css("visibility", "visible");
}

And I currently feel that my two closest attempts are:

js.ExecuteScript("('.itemId').find('#imgEdit').css('visibility', 'visible')"); //1
js.ExecuteScript("(arguments[0]).find('#imgEdit').css('visibility', 'visible')", element); //2

Can anyone give me an idea of where I am going wrong? In the first case I am getting a “.itemId”.find is not a function and in the second arguments[0].find is not a function. I see that ‘find’ is the issue potentially, but it is in the pages javascript file so I’ve got something wrong in my understanding.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T12:06:18+00:00Added an answer on June 2, 2026 at 12:06 pm

    An indirect answer but why not just use the ActionBuilder to perform the hover over an element?

    Actions builder = new Actions(driver);

    builder.moveToElement(someElement);

    builder.build().perform();

    A more direct answer… find must be a function from a javascript library, and not something available by default through the browser. If you were to do something like this:

    return ((IJavaScriptExecutor)webDriverInstance).ExecuteScript("return arguments[0].innerHTML", elementInstance).ToString();

    It would work because the innerHTML property is available from any javascript element object.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been using Selenium Webdriver successfully with JAR downloaded from their pages or
I'm using Selenium WebDriver with Java. I want to use Safari browser. Does Selenium
I am using Selenium webdriver in Python for a web-scraping project. The webpage, I
Hello all I am using webdriver so if I want to use selenium;s rc
I'm using Selenium Java 2.0b3 . I have this code: ... WebDriver driver =
I'm using Selenium 2/Webdriver with python and I want to click on the first
I've been using selenium 1, but now want to migrate to selenium2/webdriver. To be
I am using Selenium RC, TestNG, Java with Eclipse. I want to use WebDriver.
I want to automate some GUI tasks using Selenium. And integrate this task in
I'm testing with Selenium webdriver using C#. How can I log all JavaScript errors

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.