When I enter the following command into the firefox console I get 65. This is the number I want to check with selenium.
$('#grid').data('kendoGrid').dataSource.total()
Is there anyway I can get selenium to check this?
I have tried the following,
To test out javaScript, (this correctly checks title),
IJavaScriptExecutor js = driver as IJavaScriptExecutor;
string title = (string)js.ExecuteScript("return document.title");
Console.Write(var);
I have tried, both failed.
String num = (String)((IJavaScriptExecutor)driver).ExecuteScript("$('#grid').data('kendoGrid').dataSource.total()");
Console.Write(num);
&
IJavaScriptExecutor js = driver as IJavaScriptExecutor;
String script = "$('grid').data('kendoGrid').dataSource.total()";
String num = (String)js.ExecuteScript("return", script);
Console.Write(num);
I'm just using Console.Write to see the output.
returnwith the first query try. Have you tried,String num = (String)((IJavaScriptExecutor)driver).ExecuteScript("return $('#grid').data('kendoGrid').dataSource.total()");?$(document).find("title").text();and make sure it returns the correct title.