2016-08-26 3 views
0

これはhtmlコードです。idは動的です。TextField ExtJsを自動化するには? C#Selenium

[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` 

<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> 

私のコードはまた、私はあなただけの入力html要素のためのSendKeysを使用することができます

var action = new Actions(); 
action.SendKeys("21"); //not work 
action.Clik(NroInscripcion).SendKeys("21"); //not work 
+0

このdivはテキストボックスとして機能しますか? –

答えて

1

しようとしました。 div、スパンなどではありません。

div内にテキストボックスまたはテキストエリアがありますか?もしそうなら、そのWeb要素を検索し、sendkeysを使用してください。

+0

あなたのお返事ありがとうございます。私はtextareaが名前= '名前'を持っていることがわかりました。だから私は送信キーを使用することができます。ありがとうございました。 –

関連する問題