Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ms-access/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Grails geb对redactor textarea的功能测试_Grails_Spock_Geb - Fatal编程技术网

Grails geb对redactor textarea的功能测试

Grails geb对redactor textarea的功能测试,grails,spock,geb,Grails,Spock,Geb,我试图在redctor文本字段中输入文本以测试geb的功能测试。但我无法这样做,因为textarea是不可见的。当它是简单的html文本字段时,我可以通过个人{$personalStatement.valuehi我在这里}但在本例中,它不起作用。我在testspec中使用了类似于以下的personalStatement=我在这里但没有工作 <div class="redactor_redactor_content_cv redactor_ui-wizard-content redactor

我试图在redctor文本字段中输入文本以测试geb的功能测试。但我无法这样做,因为textarea是不可见的。当它是简单的html文本字段时,我可以通过个人{$personalStatement.valuehi我在这里}但在本例中,它不起作用。我在testspec中使用了类似于以下的personalStatement=我在这里但没有工作

<div class="redactor_redactor_content_cv redactor_ui-wizard-content redactor_editor" 

  contenteditable="true" dir="ltr" style="min-height: 200px;"> <p>​</p> </div> <textarea 

   id="personalStatement" class="redactor_content_cv ui-wizard-content" width="98%" 

   height="100px" name="personalStatement" dir="ltr" style="display: none;"> </textarea>

使用send keys方法在textarea中输入值

$personalStatement.firstElement.SendKeyTest

如果它真的起作用,我会感到惊讶。Geb和Selenium与UI交互。在这里,您可以有效地模拟用户在一个不可见字段中键入内容,这是不应该做的。我怀疑在使用Geb与字段交互之前,您必须使用js.exec或一些聪明的CSS技巧来秘密显示字段。