当前位置: 首页>>代码示例>>Java>>正文


Java WebForm.getButtonWithID方法代码示例

本文整理汇总了Java中com.meterware.httpunit.WebForm.getButtonWithID方法的典型用法代码示例。如果您正苦于以下问题:Java WebForm.getButtonWithID方法的具体用法?Java WebForm.getButtonWithID怎么用?Java WebForm.getButtonWithID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.meterware.httpunit.WebForm的用法示例。


在下文中一共展示了WebForm.getButtonWithID方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testPeakAction

import com.meterware.httpunit.WebForm; //导入方法依赖的package包/类
public void testPeakAction() throws Exception {

  WebResponse response = wc.getResponse(webedTestLocation
      + "/test/General/testPeakAction.jsp");
  
  WebForm form = response.getForms()[0];
  // Set the value of the field which associated with one action, 
  // then click the button and execute a second action associated 
  // with it which peaks at the parameters sent to the action 
  // associated with the field.
  String result = "NEW VALUE";
  form.setParameter((response.getElementWithID("FLD").getName()),result);      
  Button button = form.getButtonWithID("BTN");
  button.click();
  assertEquals("The target value was not visable", result, wc.getCurrentPage().getText());
}
 
开发者ID:ontopia,项目名称:ontopia,代码行数:17,代码来源:GeneralActionTest.java

示例2: testFormUnregister

import com.meterware.httpunit.WebForm; //导入方法依赖的package包/类
public void testFormUnregister() throws Exception {
  WebResponse resp = wc.getResponse(webedTestLocation
      + "/test/General/testFormUnregister.jsp");
  WebForm form = resp.getForms()[0];
  Button button = form.getButtonWithID("testFormUnregister");
  
  String requestId = form.getParameterValue(Constants.RP_REQUEST_ID);
  wc.getResponse(webedTestLocation + "/unregister?requestid=" + requestId);
  
  try {
    button.click();
    fail("Failed to unregister form action data.");
  } catch (HttpInternalErrorException e) {
  }
}
 
开发者ID:ontopia,项目名称:ontopia,代码行数:16,代码来源:GeneralActionTest.java

示例3: clickButton

import com.meterware.httpunit.WebForm; //导入方法依赖的package包/类
/**
 * Click on the button with a given ID and on the first form.
 * @param buttonID The id of the button to click.
 * @throws SAXException
 * @throws IOException
 */
protected void clickButton(String buttonID) throws SAXException, IOException {
  WebForm forms[] = resp.getForms();
  assertTrue(forms.length > 0);
  WebForm form = forms[0];
  Button button = form.getButtonWithID(buttonID);
  assertNotNull(button);
  button.click();
  resp = wc.getCurrentPage();
}
 
开发者ID:ontopia,项目名称:ontopia,代码行数:16,代码来源:AccessctlTest.java

示例4: clickButton

import com.meterware.httpunit.WebForm; //导入方法依赖的package包/类
/**
 * Click on the button with a given ID within the first form.
 * @param buttonID The id of the button to click.
 * @throws SAXException
 * @throws IOException
 */
protected void clickButton(String buttonID) throws SAXException, IOException {
  log.debug("Clicking Button: " + buttonID);
  WebForm forms[] = resp.getForms();
  assertTrue(forms.length > 0);
  WebForm form = forms[0];
  Button button = form.getButtonWithID(buttonID);
  assertNotNull(button);
  button.click();
  resp = wc.getCurrentPage();
}
 
开发者ID:ontopia,项目名称:ontopia,代码行数:17,代码来源:AccessctlRandomizedTest.java


注:本文中的com.meterware.httpunit.WebForm.getButtonWithID方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。