While using Selenium, I am trying to execute a getEval function 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];
Executing this code in the console returns the correct result.
However, when I navigate to the specific page where the element is located and click the "find" button in Selenium, the correct element is highlighted. But, when I run the same line of code in Selenium itself - even after navigating to the correct page and running ONLY that line - it throws an error message saying:
[error]Threw an exception: document.getElementById(...)is null
How can I resolve this issue?