In selenium for input, we can enter a value similar to:
WebElement inputBox = driver.findElement(By.xpath(xpath))); inputBox.sendKeys("abc");
but on one webpage I have one button after clicking on it to get one div, which I have to enter through selenium, I get xpath for this div, like
WebElement inputDiv = driver.findElement(By.xpath("//div[contains(@class,'x-grid3-cell-inner')]")); inputDiv.sendKeys("abc"); //This is not working
using xpath, I get a div, but how to enter text in that using xpath?
Html after adding text manually:
<div class="x-grid3-cell-inner">ty</div>
The div into which I should enter the text includes:
<div class="x-grid3-cell-inner" />
source share