Skip to content

Instantly share code, notes, and snippets.

@huguogang
Created October 11, 2013 06:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save huguogang/6930210 to your computer and use it in GitHub Desktop.
Save huguogang/6930210 to your computer and use it in GitHub Desktop.
get ExtJS grid selected data, and use JUnit assertion to verify the result
String gridQuery = "viewport #grid1";
String js = "return Ext.ComponentQuery.query('" + gridQuery
+ "')[0].getSelectionModel().getSelection()[0].data";
@SuppressWarnings(value="unchecked")
Map<String, Object> row = (Map<String, Object>)((JavascriptExecutor) _driver).executeScript(js);
assertThat("Project name", row.get("ProjectName").toString(), equalTo("Expected Project Name"));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment