Have textarea wrapped in parent div element.
This textarea becomes visible only when parent is hovered with mouse.
I tried the following:
WebElement pr = driver.findElement(parent);
Actions builder = new Actions(driver);
builder.moveToElement(pr).peform();
driver.findElement (textarea).sendKeys (text);
But when webdriver started to look for child textarea it lost focus on parent.
Have to do something that could afford sending text to child element when parent stays hovered. Is it possible?
You would have to use javascript – I don’t think that webdriver can handle more than one element at a time.
Your options as I see them:
You could try modifying the ‘style’ attribute of the textarea with javascript to force it to be visible and then interact with it in webdriver the usual way (i.e. sendkeys).
Set the text of the textarea via javascript, note that you won’t be triggering any events because you aren’t actually typing anything in.