Hi I have the following snipped of HTML:
<tr rowid="0" class="addedrow rowselected datarow rowfocus">
....
<td positionindex="3" class="primary required">
<input type="text" class="editablecell" size="15">
</td>
<td positionindex="4" class="required">
<div class="select2-container editablecell" id="s2id_autogen1" style="width: 99%;" title="">
<a href="javascript:void(0)" onclick="return false;" class="select2-choice select2-default" tabindex="-1">
</a>
</div>
</td>
....
I have to insert text into the <input type="text" class="editablecell" size="15">
text field. I am having difficulties in locating this particular WebElement
using Selenium in Java.
I have tried this
WebElement box = driver.findElement(By.xpath("//input[(@type='text') and
(@class='editablecell')]"));
based on the anser here.
Note: This element is in the following structure:
<html> ....
<body> ...
<div id=topLeveWrapper> ...
<div id=header> ...
<div id=contentFrame> ...
<div id=leftSite> ...
<div id=rightSite> ...
<div id=pageID_123456> ...
<div id=gridViewID_98765> ...
<div id=tableWrapper> ...
<div id=twHEADER> ...
<div id=twBODY> ...
<table >
<thead> ...
<tbody>
<tr rowid=0 ...>
<td positionindex="3" class ="primary required"> <input type="text" class="editablecell" size="15">
</td>
....
</tr>
......................
Exeption thrown is:
Exception in thread "main" org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"xpath","selector":"//input[@type='text' and @class='editablecell']"}
(Session info: chrome=..)
Info:
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Can anyone guid me on this, please?
Thanks