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.