Reputation: 1
This is html code, id is dynamic.
<td id="ext-gen2730" class="x-grid-cell x-grid-td x-grid-cell-headerId-gridcolumn-1246 x-grid-cell-last g-cell-edit x-grid-cell-selected">
<div id="ext-gen2726" class="x-grid-cell-inner " style="text-align: left ! important;">&nbps</div>
my code
[FindsBy(How = How.XPath, Using = "//tbody/tr/td[4]/div")]
private IWebElement NroInscripcion;
NroInscripcion.Click();` // this work
NroInscripcion.SendKeys("20"); // not work -> An exception of type 'System.Reflection.TargetInvocationException' occurred in mscorlib.dll but was not handled in user code`
also i tried to
var action = new Actions();
action.SendKeys("21"); //not work
action.Clik(NroInscripcion).SendKeys("21"); //not work
Upvotes: 0
Views: 91
Reputation: 9058
You can only use sendKeys for an input html element. Not a div, span etc.
Do you have a textbox or textarea inside the div? If so search for that webelement and then use sendkeys
Upvotes: 1