I could not able to execute the JavaScript code in Selenium.
As I have followed the Training Module 16 - Part2. I can see the trainer using the below code to execute. when I try the same code I could not able to execute.
I am getting the below error when i try the same code : when i place my cursor on the "executeScript" [b:2s4f41wk][i:2s4f41wk][u:2s4f41wk]The method executeScript(String, Object[]) in the type JavascriptExecutor is not applicable for the arguments (String)[/u:2s4f41wk][/i:2s4f41wk][/b:2s4f41wk]
If I add [b:2s4f41wk]"null"[/b:2s4f41wk] as a second parameter. Error disappear and when I run my code. I am getting [b:2s4f41wk]"NullPointerException"[/b:2s4f41wk] [b:2s4f41wk][i:2s4f41wk][u:2s4f41wk]((JavascriptExecutor)wd).executeScript("alert('Hello')",null);[/u:2s4f41wk][/i:2s4f41wk][/b:2s4f41wk]