Share
Go down
kumar123
Posts : 1
Join date : 2012-09-10

EDIT TEXT AREA

on Mon Sep 10, 2012 12:54 am
I want to edit text present in text area of a webpage and then updated text should appear in that webpage text area.

I have tried using below code, but i am getting htmlSource element not found exception.

driver.findElement(By.xpath("(//textarea[@id='htmlSource'])")).sendKeys("My text to your text edit");

can any one help me i have tried may ways used xpath, name, id etc but no help i got. Please help.
I am using selenium, testng scripts. JDK1.6

Regards,
kumar.
sreekumar
Active particpant
Active particpant
Posts : 16
Join date : 2011-12-27
Age : 33
Location : Hyderabad

Re: EDIT TEXT AREA

on Wed Sep 12, 2012 3:13 pm
Kumar 123

First clear the text box and add the new text.

driver.findbyElement(By.xpath("").clear();

driver.findElement(By.xpath("(//textarea[@id='htmlSource'])")).sendKeys("My text to your text edit");

Now it will update new text every time in text box
Back to top
Permissions in this forum:
You cannot reply to topics in this forum