Open Twebst - 針對IE瀏覽器的Web自動化測試

jopen 12年前發布 | 39K 次閱讀 測試工具

Open Twebst是一個開源Web自動化框架,主要針對Internet Explorer瀏覽器,可以用在任何支持COM的環境,從腳本語言的JScript,VBScript到高級編程語言C#,VB.Net,VBA / Excel,Python,C++。

該框架包括兩個部分組成:1、Open Twebst Web Recorder:自動生成大部分IE自動化代碼。2、Open Twebst Library:一個可編程的對象集合,用于創建一個Web自動化API。

項目地址: http://open-twebst.codecentrix.com/
當前版本: 1.1
系統要求: Windows XP, Windows Vista, Windows 7 + IE 6.0 ? 9.0
License & Pricing: open source, GPL v3 (http://www.gnu.org/licenses/gpl-3.0.html)
支持: for programming and features related questions about the product we strongly encourage you to use Twebst Google Group at: https://groups.google.com/forum/#!forum/twebst-automation-studio
安裝: the installation runs smoothly through a NSIS installer.
文檔: http://doc.codecentrix.com/ (the setup comes with a CHM help file as well).

特性:

  • Start new IE browsers and navigate to a specified URL.
  • Connect to existing browsers.
  • Get full programmatic control over HTML elements and frames.
  • Intuitive names for HTML elements using the text that appears on the screen.
  • Advanced search of browsers and HTML elements using wildcards.
  • Perform actions on all HTML controls (button, combo-box, list-box, edit-box, upload control).
  • Simulates user behavior generating hardware or browser events.
  • Get access to native interfaces exposed by Internet Explorer so you don't need to learn new things if you already know IE web programming.
  • Synchronize web actions and navigation by waiting the page to complete in a specified timeout.
  • Available from any programming/scripting language that supports COM
  • Optimized search methods and collections.
  • Easily create web macros through an intuitive graphical interface.
  • Generate web automation code using the language of your choice: Python, JScript, VBScript, C#, VB.Net, Watir.
  • Record web actions on all HTML web controls (anchor, button, combo-box, list-box, edit-box)

You can create a script simply recording your actions on the web page. Here is a picture of Open Twebst Web Recorder generating JScript code:

Open Twebst - 針對IE瀏覽器的Web自動化測試

Code sample:

var core = new ActiveXObject('OpenTwebst.Core');

var browser = core.StartBrowser('http://mail.yahoo.com/?);

browser.FindElement('input text', 'id=username').InputText('codecentrix');

browser.FindElement('input password', 'id=passwd').InputText('1234');

browser.FindElement('button', 'id=.save').Click();

The script above automates the login page on Yahoo email web site. First we need a Core object to start a new Browser. Once we have the browser object we can search for HTML objects inside the web page.

FindElement method waits the page to be completely loaded before searching the DOM. Its behavior can be customized using several properties like: loadTimeout, searchTimeout and loadTimeoutIsError.

Once we have the Element, we can perform actions on it like: Click, InputText, Select. These automation methods simulate user actions generating all the relevant HTML events on target object.

Random facts:

Open Twebst Library contains only 5 types of objects: Core, Browser, Frame, Element and ElementList.

Open Twebst Web Recorder supports the following languages: VBScript, JScript, C#, VB.Net, Python and Watir.

While looking for HTML objects inside DOM, the whole frame/iframe hierarchy is taken into account. It works even for frames/iframes loaded from different domains bypassing cross domain security restrictions.

It can automate pop-ups and HTML modal/modeless dialog boxes. See: ClosePrompt, ClosePopup, FindModelessHtmlDialog and FindModalHtmlDialog.

You can gain access to native IHTMLElement and IWebBrowser2 objects exposed by IE using nativeElement and nativeBrowser properties.

You can attach to existing IE browser and even IE web browser controls embedded in other applications using FindBrowser method.

Wildcards can be used when searching for HTML objects in the web page. See: Search Conditions.

It works with all Internet Explorer versions from 6.0 to 9.0 + support for protected mode.

Further Readings

Open Twebst web-site: http://open-twebst.codecentrix.com/

Documentation: http://doc.codecentrix.com/

Twebst Google Group: https://groups.google.com/forum/#!forum/twebst-automation-studio

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!