Unable to send values in the table column. I got different errors while I am trying to insert a value in the column using Selenium.
I tried to set a new value in the table's column. It shows the error as The element must be user-editable in order to clear it.
WebElement.clear(); WebElement.sendKeys("value"); (or) WebElement.sendKeys(Keys.DELETE); WebElement.sendKeys("value");
Then to click and edit the value.
Actions actions = new Actions(getWebDriverEx()); WebElement TableColumn = Driver.findElement(By.id("element")); actions.moveToElement(TableColumn); actions.click().build().perform(); actions.sendKeys(Keys.BACK_SPACE+b+b); actions.sendKeys("value");
The value which was passed is not inserted in the Tables column. But I can able to click the Tables column. Here my test passed.
Then tried to set value. It shows the error as timed out.
WebElement.sendKeys(Keys.DELETE); WebElement.sendKeys("15000");
Again I used the div/span combination as XPath and I have edited the value. But it does not reflect in the table.
JavascriptExecutor js = (JavascriptExecutor) getDriver(); js.executeScript("document.getElementById('element').innerHTML="+15000);
Here I do not get any errors. But the value not reflected after save.
I gave element to various formats.
- div//[id]
- div//span
- XPath
- id alone (which was in the div)
HTML:
<div id="element" class="tables_second_column">
<div class="class_name">
<div class="class_name">
<div class="class_name"><span>5000</span></div>
</div>
</div>
</div>