1

This is my current code

WebElement textarea_click = driver.findElement(By.xpath("//*[@id=\"gvPods_txt_Comment_" + i + "\" ]"));
                        
             textarea_click.click();
             Thread.sleep(15000);
System.out.println("Text area is open");

                        
textarea_click.append = ("XWC status is NOGO");

Thread.sleep(2000);`

I intend to append the value of textarea_click.

1 Answer 1

0

You can get the value of the textarea via

textarea_click.getAttribute("value")

And you can append the value via

setAttribute(textarea_click,"value",textarea.getAttribute("value") + "XWC status is NOGO");

Sources:

https://vaadin.com/forum/thread/3803119/get-value-from-textfield-textarea-using-selenium https://groups.google.com/g/selenium-users/c/3J27G1GxCa8?pli=1

Sign up to request clarification or add additional context in comments.

3 Comments

This didn't worked.I tried in below manner WebElement textarea_click = driver.findElement(By.xpath("//*[@id=\"gvPods_txt_Comment_" + i + "\" ]")); driver.findElement(By.name("gvPods$ctl10$txt_Comment" )); textarea_click.click(); Thread.sleep(15000); System.out.println("Text area is open"); textarea_click.getAttribute("value"); setAttribute(textarea_click, "value",textarea_click.getAttribute("value") + " XWC is NOGO");
@TejashreeVeer can you elaborate on how did it fail? Did you get an error?
i don't get any error. But i don't see the result also. The value which i want to add to the value already present in textarea is not getting added.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.