使用Watin做Web UI Automation Test
1.使用Package Manager Console 安裝Watin
PM> install-package watin
2.準備一個測試頁面:
<html xmlns="http://www.w3.org/1999/xhtml">
<head >
<title></title>
</head>
<body>
<div>
<input type="text" id="txtUserName"/>
<input type="button" id="btnSubmit" value="Submit"/>
</div>
<script>
document.getElementById("btnSubmit").onclick = function() {
document.getElementById("txtUserName").value = "hello";
}
</script>
</body>
</html>
3.deploy測試頁面到本地
4.建立UT,新增程式碼:
IE ie = new IE();
ie.GoTo("http://192.168.0.30:81/LocalWebApp/watinTest/1.html");
ie.ShowWindow(NativeMethods.WindowShowStyle.Maximize);
ie.TextField(Find.ById("txtUserName")).TypeText("watin");
ie.Button(Find.ById("btnSubmit")).Click();
var txt = ie.TextField(Find.ById("txtUserName"));
Assert.IsTrue(txt.Value == "hello");
相關文章
- Azure 基礎 : 使用 Automation 定時開機
- web UI 自動化工具katalon使用WebUI
- WEB UIWebUI
- web ui 框架WebUI框架
- 使用Gatling做web壓力測試Web
- 如何使用 SAP Intelligent Robotic Process Automation 自動操作 ExcelIntelExcel
- 使用Ingress-Nginx來暴露ArgoCD Web-UINginxGoWebUI
- web前端是做什麼的?UI設計又是做什麼的?看完別選錯行!Web前端UI
- 使用SQL4Automation讓CodeSYS連線資料庫SQL資料庫
- Java Web UI框架JavaWebUI框架
- 在Web API程式中使用Swagger做介面文件WebAPISwagger
- 使用SAP UI5 Web Components開發React應用UIWebReact
- 如何使用SAP UI5 Web Component for React的padding功能UIWebReactpadding
- YLazy Web Page Test , 網頁效能測試平臺Web網頁
- SAP UI5 System Test 的工具之一:uiveri5UI
- test資訊收集11(mimikatz使用)
- Windows 部署 Stable Diffusion web UIWindowsWebUI
- Cube-UI 最近做的更新UI
- UI很忙?那我自己做雪碧圖UI
- What?JMeter做UI自動化!JMeterUI
- ETL工具-nifi乾貨系列 第三講 nifi web ui 使用教程NifiWebUI
- Spring Boot Test 的詳細使用教程Spring Boot
- ABAP TEST-SEAM 的使用方法
- test
- 什麼是SAP Intelligent Robitic Process Automation - iRPAIntel
- 支援 etcdv3 的 web ui 工具WebUI
- 關於 SAP UI5 Web ComponentsUIWeb
- web的高度計算-cell-裡面使用-只做記錄Web
- test_NO
- Unit test
- vue單元測試vue test utils使用初探Vue
- 【Android Test】糟心的“Empty test suite ”異常AndroidUI
- python怎麼做web開發PythonWeb
- python基於Json Web Token做服務端使用者認證PythonJSONWeb服務端
- 玩轉web3第二篇——Web3UI KitWebUI
- Fiori Fundamentals和SAP UI5 Web ComponentsUIWeb
- X-UI 使用UI
- AB test 中的AA test有什麼作用?
- 使用Vue.js和Element-UI做一個簡單的登入頁面Vue.jsUI