I am trying to retrieve DOM element and pass it to third-party js script. I'm running javascript from java and first I use document.getElementById function to find it and then use it in another function. So, for instance, ID (which is dynamic) is isc_B6 and then function call looks like:
window.isc.AutoTest.getLocator(document.getElementById("isc_B6"))
and when I run it with Firebug it returns exactly what I want. But when I try to run it from Java:
public String getSCLocator(String id) {
return selenium.getEval("window.isc.AutoTest.getLocator(document.getElementById(\"" + id + "\"))");
}
I get a value related to the DOM element that the mouse pointer is hovering over at the moment. I am sure that id is correct, because I can loop this function call and wait until value meets requirements - it happens when I hover over desired DOM element.