我正在编写一个thusyides测试,以复制一个场景,在该场景中,当有人在文本区域中键入段落时,文本字段会被添加值。
我的方法是在测试用例中创建一个循环。
@FindBy(id="my-description")
private WebElement textArea;
@Test
public void my_test(){
for(int i=0;i<10;i++){
String value = $(textArea).getValue();
value = value + description;
$(textArea).type(value);
//waitForsometime(200);
}
}
问题是,在与累积值一起重新出现之前,每次迭代的值都会消失。我有什么办法可以做到这一点?
$(textArea).type()
将在输入任何值之前清除该字段。我们必须使用
$(textArea).sendKeys()
相反。