I am encountering an issue with the getDuration command in jwplayers. I suspect that it might be related to a translation problem between C#'s javascript executor. Any help or insights are greatly appreciated.
Here is the problematic C# code:
IJavaScriptExecutor executor = ( IJavaScriptExecutor )Driver;
executor.ExecuteScript( "jwplayer().seek(jwPlayer().getDuration());", "" );
And here is the working Javascript code that functions properly in Chrome Console:
jwplayer().seek(jwPlayer().getDuration())
The above code executes as expected.
executor.ExecuteScript( "jwplayer().seek(45);", "" );
However, when running this next piece of code, it fails:
executor.ExecuteScript( "jwplayer().getDuration();", "" );
Upon execution, I encounter the following error message:
unknown error: Runtime.evaluate threw exception: TypeError: Cannot read property 'click' of null
(Session info: chrome=35.0.1916.153) (Driver info: chromedriver=2.10.267521,platform=Windows NT 6.1 SP1 x86_64)