当前位置:编程学习 > asp >>

Continue

答案:User Inte易做图ce - How the user interacts with the product is very important, in part because in some cases the user will be someone very familiar with WebSite browsing and not necessarily a testing expert. The design we implemented takes this reality into account.
·         "C" Scripting. We use interpreted "C" language as the control language because the syntax is well known, the language is fully expressive of most of the needed logic, and because it inte易做图ces well with other products.
·         Files Inte易做图ce. We implemented a set of dialogs to capture critical information and made each of them recordable in a text file. The dialogs are associated with files that are kept in parallel with each browser invocation:
o        Keysave file: This is the file that is being created the file is shown line by line during script recording as the user moves around the candidate WebSite.
o        Timing file: Results of timings are shown and saved in this file.
o        Messages file: Any error messages encountered are delivered to this file. For example, if a file can't be downloaded within the user-specified maximum time an error message is issued and the playback continues. (This helps preserve the utility of tests that are partially unsuccessful.)
o        Event file: This file contains a complete log of recording and playback activities that are useful primarily to debug a test recording session or to better understand what actually went on during playback.
·         Operational Features.Based on prior experience, the user inte易做图ce for CAPBAK/Web had to provide for several kinds of capabilities already known to be critical for a testing system. Many of these are critically important for automated testing because they assure an optimal combination of test script reliability and robustness.
o        Script Capture/Replay: We had to be able to capture a user's actual behavior online, and be able to create scripts by hand.
    • Object Mode: The recording and playback had to support pure-Object Mode operation. This was achieved by using internal information structures in a way that lets the scripts (either recorded or constructed) refer to objects that are meaningful in the browser context.
    • [Adjustable] True-Time Mode: We assured realistic behavior of the product by providing for recording of user-delays and for efficient handling of delays by incorporating a continuously variable "playback delay multiplier" that can be set by the user.
    • Playback Synchronization: For tests to be robust there must be a built-in mode that assures synchronization so that Web-dependent delays don't interfere with proper WebSite checking. CAPBAK/Web does this using a proprietary playback synchronization method that waits for download completion (except if a specified maximum wait time is exceeded).
    • Timer Capability: To make accurate on-line performance checks we built in a 1 millisecond resolution timer that could be read and reset from the playback script.
    • Validate Selected Text Capability: A key need for WebSite content checking, as described above, is the ability to capture an element of text from an image so that it can be compared with a baseline value. This feature was implemented by digging into the browser data structures in a novel way (see below for an illustration). The user highlights a selected passage of the web page and clicks on the "Validate Selected Text" menu item.



Figure 1. Illustration of CAPBAK/Web Validate Selected Text Feature.
What results is a recorded line that includes the ASCII text of what was selected, plus some other information that locates the text fragment in the page. During playback if the same text is not found at the same location an error message is generated.
    • Multiple-playback: We confirmed that multiple playback was possible by running separate copies of the browser in parallel. This solved the problem of how to multiply a single test session into a number of test sessions to simulate multiple users each acting realistically.

·         Test Wizards - In most cases manual scripting is too laborious to use and 易做图 a recording to achieve a certain result is equally unacceptable. We built in several test wizards that mechanize some of the most common script-writing chores.
o        Link Wizard: This wizard creates a script based on the current Web page that visits every link in the page. Scripts created this way are the basis for "link checking" test suites that confirm the presence (but not necessarily the content) of URLs.
    • FORM Wizard: For E-Commerce testing which involves FORMS we included in the system a FORM Wizard that generates a script that:
      • Initializes the form.
      • Presses each pushbutton by name.
      • Presses each radio button by name.
      • Types a pre-set script fragment into each text field.
      • Presses SUBMIT.

Here is a sample of the output of this wizard, applied to our standard test page:
 
  void name()
  {
  /* Produced by CAPBAK/Web [IE] Ver. 1.5 Form Wizard */
  /* (c) Copyright 1999 by Software Research, Inc. */
  
  WT_InitLink("http://www.testworks.com/Products/Web/CAPBAK/example1/");
  WT_SubmitForm(FORM:0:12, "RESET FORM");
  WT_SelectOneRadio(FORM:0:0, "now", "TRUE");
  WT_SelectOneRadio(FORM:0:1, "next", "TRUE");
  WT_SelectOneRadio(FORM:0:2, "look", "TRUE");
  WT_SelectOneRadio(FORM:0:3, "no", "TRUE");
  WT_SelectCheckBox(FORM:0:4, "concerned", "TRUE");
  WT_SelectCheckBox(FORM:0:5, "info", "TRUE");
  WT_SelectCheckBox(FORM:0:6, "evaluate", "TRUE");
  WT_SelectCheckBox(FORM:0:7, "send", "TRUE");
  WT_FormTextInput(FORM:0:8, "TestWorks");
  WT_FormTextInput(FORM:0:9, "TestWorks");
  WT_FormTextInput(FORM:0:10, "TestWorks");
  WT_FormTextInput(FORM:0:11, "TestWorks");
  WT_SubmitForm(FORM:0:13, "SUBMIT FORM");
  } 

上一个:使用 IIS 5.0 调整 Web服务器的艺术与科学--1
下一个:调查:有谁是这样做的?请跟帖

CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,