c# - Webdriver: Interact with grid -
To edit the content of a cell on which you have to double click on it even though with the Webdriver they have an API There is no doubleclick function. How else can I change the contents of a cell?
Which grid are you asking about? There is a JavaScript function to start editing cells for most grids.
Still you can double click with javascript. Below is a IWebElement
that you want to double click on element
:
for InternetExplorerDriver
:
((IJavascriptExecutor) driver) .ExecuteScript ("Logic [0] .fireEvent ('onblblick')", element); For FirefoxDriver
and 'ChromeDriver': ((IJavascriptExecutor) driver) .ExecuteScript ("var evt = document. CreateEvent ('MouseEvents'); evt.initMouseEvent ('dblclick', "+" true, true, window, 0, 0, 0, 0, false, false, false, false, 0, "+" null); "+" Logic [0]. Disappeared (EVT); ", Element);
Comments
Post a Comment