I am running a getEval in Selenium with the following javascript:
document.getElementById("j_id0:j_id3:mainBlock:j_id40").children[0].children[0].children[0].children[0].children[0].children[0] .children[2].children[0].children[0].children[0] .children[0].children[1];
When I run the code in the console, it returns the correct result.
When I navigate to the page on which the element I need to locate exists and click the "find" button in Selenium, it finds and highlights the correct element. Hoever, when I actually run the line in Selenium - even when I navigate to the correct page and run ONLY that line - I get a message that says
[error]Threw an exception: document.getElementById(...)is null
How do I make this work correctly?