ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to write some text in textarea on a webpage using Selenium WebDriver (https://www.excelbanter.com/excel-programming/450234-how-write-some-text-textarea-webpage-using-selenium-webdriver.html)

sachin ahuja

How to write some text in textarea on a webpage using Selenium WebDriver
 
Hi,

I am using below code to write text in textarea on a webpage.

WebDriver driver=new FirefoxDriver();
driver.findElement(By.id("description")).sendkeys( "some value");

// This code write character by character.

I tried same with JavascriptExecutor with below code for textbox(input tag) but it doesn't work for textarea.

WebElement element=driver.findElement(By.id("description"));
JavascriptExecutor js=(JavascriptExecutor)driver;
js.executeScript("arguments[0].setAttribute('value',arguments[1]);",element,"some value);


Please help me to write some text in textarea tag. That will be replacement of "sendKeys()".


Thanks
Sachin Ahuja


Auric__

How to write some text in textarea on a webpage using Selenium WebDriver
 
sachin ahuja wrote:

I am using below code to write text in textarea on a webpage.

[snip]
I tried same with JavascriptExecutor with below code for textbox(input
tag) but it doesn't work for textarea.

[snip]
Please help me to write some text in textarea tag. That will be
replacement of "sendKeys()".


Unfortunately, this group is dedicated to programming Microsoft Excel (thus
the "excel" in the group name). I suggest starting with the SeleniumHQ
support page:

http://docs.seleniumhq.org/support/

That page says "The best place to ask for help is the user group":

https://groups.google.com/forum/#!forum/selenium-users

--
I'll try being nicer if you'll try being smarter.

sachin ahuja

How to write some text in textarea on a webpage using Selenium WebDriver
 
Thanks Auric.


All times are GMT +1. The time now is 09:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com