这是我当前的代码
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);`
我打算附加
textarea_click
的值。
您可以通过
获取
textarea
的值
textarea_click.getAttribute("value")
您可以通过
附加值setAttribute(textarea_click,"value",textarea.getAttribute("value") + "Deepthi");
来源:
https://vaadin.com/forum/thread/3803119/get-value-from-textfield-textarea-using-selenium https://groups.google.com/g/selenium-users/c/3J27G1GxCa8?pli=1