我的一亩三分地 我就喜欢!
13fen  设为主页
 收藏本站
 
当前位置: > 一亩三分地:首页 > 网络学院 > 网络编程 > ASP专区 > Asp客户端/系统 > Continue
热门文章排行
热门文章排行 手推车”功能的实现(10-07)
八大法则防范ASP网站漏洞(10-23)
ASP教程十一、调试ASP脚本(10-23)
在JSP中访问数据库大全(10-23)
虚机服务中常见Asp.Net低级错误一览(03-21)
精采文章排行
精采文章排行 ASP.NET实现抓取网页中的链接(11-15)
ASP连接数据库的11种方法(11-10)
如何动态创建网页的RSS内容摘要(11-10)
ASP网站漏洞及入侵防范方法(11-10)
ASP自定义函数:对字符串正则替换(11-10)
技术专题推荐
网管论坛交流
 

Continue 

作者:佚名   来源:一亩三分地   点击:   日期:2007-03-23

User Interface - 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 interfaces well with other products.
·         Files Interface. 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 interface 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 making 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");
  } 


文章评论】 【收藏本文】 【推荐好友】 【打印本文】 【论坛讨论

   相关文章:
·ASP中巧用Response属性 ·第六课:ASP脚本循环语句
·在 Web 页上使用条件数值格式 ·连接数据库查询手册(不仅仅适用于asp)
·警惕"给你的FileSystemObject对象加把锁" ·用ASP做全文检索

   文章评论:(条)
  
 请留名: 匿名评论   点击查看所有评论 网管论坛
 

  责任编辑:一分  声明:刊登此文章是为了传递更多信息,文章内容仅供参考,转载请注明出处。