此脚本是验证51test博客发博客到私人信箱里面。下图如已经登录了页面
Option Explicit Browser("284772894 日志 - 284772894的个人空间").Page("284772894 日志 - 284772894的个人空间").Link("发布新日志")_;_script infofile_;_ZIP::ssf2.xml_;_ Browser("284772894 日志 - 284772894的个人空间").Page("284772894 日志 - 284772894的个人空间").Link("发布新日志") Dim tYear,tMonth,tDay,expSubject,actSubject,actPwd,dateArrary 'step1 Browser("284772894 日志 - 284772894的个人空间").Page("284772894 日志 - 284772894的个人空间").Link("发布新日志").Click 'step2------------------- '保存日期为标题使用 dateArrary = Date dateArrary = Split(dateArrary,"/") msgbox dateArrary(0) tYear = dateArrary(0):tMonth = dateArrary(1):tDay = dateArrary(2) If tMonth < 10 Then tMonth = "0"&tMonth End If If tDay < 10 Then tDay = "0"&tDay End If print tYear print tMonth print tDay expSubject = "日志 ["& tYear &"年"& tMonth &"月"& tDay& "日]" print expSubject With Browser("284772894 日志 - 284772894的个人空间").Page("个人空间管理") .Image("calendar").Click .WebList("catid").Select "软件测试技术" .WebList("itemtypeid").select "原创" '下面是 WebElement("html tag:=BODY") 解决不识别webelement问题 .Frame("Frame").WebElement("html tag:=BODY").Object.innerText = "284772894的博客内容" .WebEdit("password").set "123456" '---------------------checkpoint start actSubject = .WebEdit("subject").GetROProperty("Value") actPwd = .WebEdit("password").GetROProperty("Value") If actSubject = expSubject and actPwd = "123456" Then Reporter.ReportEvent micPass,"step 2","passed" Else Reporter.ReportEvent micFail, "step 2","failed" ExitTest End If '-----------------------------checkpoint end 'stpe3----------------------------------- .WebButton("保存到私人箱").Click End With