2
我在HTML單元的幫助下測試論壇PhpBB。我想在PhpBB論壇的主題之一添加消息。我在textarea中輸入消息並單擊提交按鈕,但新頁面沒有我的消息。什麼似乎是問題?PhpBB論壇的測試
final ArrayList<HtmlForm> formList=(ArrayList<HtmlForm>) page.getByXPath("//form[@id='postform']");
final HtmlTextArea myMessage=formList.get(0).getTextAreaByName("message");
myMessage.type("text");
final HtmlSubmitInput submit_post = formList.get(0).getInputByName("post");
page=submit_post.click();
if (page.asText().contains("text")) {
System.out.println("right");
}
謝謝你的幫忙!