扒开腿挺进岳湿润的花苞视频|将军边走边挺进她H树林|挺进朋友人妻张婉莹身体|岳脱得精光让我挺进去视频|第一次挺进莹莹的身体里视频|脱岳裙子从后面挺进去视频

新疆軟件開發(fā)

本站首頁 軟件開發(fā) 成功案例 公司新聞 公司簡介 客服中心 軟件技術(shù) 網(wǎng)站建設(shè)
  您現(xiàn)在的位置: 新疆二域軟件開發(fā)公司 >> 開發(fā)語言 >> 文章正文

VBScript常用函數(shù)介紹

  在寫QTP腳本的時候,有一些經(jīng)常使用的函數(shù)。
    如果我們能熟悉這些常用的函數(shù)及其用法,并合理地使用它們,那么一些問題就很容易得到解決。下面是我總結(jié)的VBScript中常用的函數(shù)及其用法。
1,GetROProperty
  說明:You use the GetROProperty method to retrieve the current value of a test object property from a run-time object in your application.
  一般來說,所有的對象都可以使用此方法得到運行時對象的實際值。
  語法:object.GetROProperty (Property, [PropertyData])
如 
ButtonName=Browser("QA Home Page").Page("QA Home Page").WebButton("Submit").GetTOProperty("Name")
2,WaitProperty
  說明:Waits until the specified object property achieves the specified value or exceeds the specified timeout before continuing to the next step. 
  此方法可以解決由于等待系統(tǒng)進行處理某些操作或網(wǎng)絡(luò)原因引起的測試對象同步問題。
     語法:object.WaitProperty (PropertyName, PropertyValue, [TimeOut])

Window("Test").Static("Status:").WaitProperty "text", "Ready", 30000
3,Instr
Returns the position of the first occurrence of one string within another.
  可以得到一個字符串在另外一個字符串中首次出現(xiàn)的位置。
  語法: InStr([start, ]string1, string2[, compare])
4,Split
Returns a zero-based, one-dimensional array containing a specified number of substrings.
  此函數(shù)可以把原來用某個特殊字符串連接起來的字符串分割開,得到一個一維的數(shù)組。
5,UBound
Returns the largest available subscript for the indicated dimension of an array.
得到某個維度的最大值。
6,Trim
Returns a copy of a string without leading spaces (LTrim), trailing spaces (RTrim), or both leading and trailing spaces (Trim).
  如果需要刪除字符串左邊的所有空格,那么可以使用LTrim  函數(shù);如果需要刪除字符串右邊的所有空格,那么可以使用RTrim  函數(shù)。如果需要刪除字符串左邊和右邊的所有空格,那么可以使用Trim  函數(shù)。
7,Ucase
Returns a string that has been converted to uppercase.
  此函數(shù)可以把所有的字符都轉(zhuǎn)換成相應(yīng)的大寫。
8,LCase
Returns a string that has been converted to lowercase.
  此函數(shù)可以把所有的字符都轉(zhuǎn)換成相應(yīng)的小寫。
9,Cstr
Returns an expression that has been converted to a Variant of subtype String.

  由于VBScript只有一種類型Variant,你可以使用此函數(shù)把某個變量強制轉(zhuǎn)換成String類型。
10,CInt
Returns an expression that has been converted to a Variant of subtype Integer.
  由于VBScript只有一種類型Variant,你可以使用此函數(shù)把某個變量強制轉(zhuǎn)換成Integer類型。
  在描述性編程語句中,最常用的函數(shù)有:

11,Create 
  這是創(chuàng)建一類或一個對象時必須要使用的方法。

12,ChildObjects 
  使用此方法可以得到符合某些條件的一類對象的集合。

13,Count
  使用使用此方法可以得到符合某些條件的一類對象的個數(shù)。
The following example uses the Create method to return a Properties collection object named EditDescription, and then uses the returned object to instruct QuickTest to enter the text: MyName in the first WebEdit object in the Mercury Tours page with the name UserName. 
Set EditDesc = Description.Create() 
EditDesc("micclass").Value = "WebEdit"
EditDesc("Name").Value = "userName" 

Set Lists = Browser("Welcome: Mercury").Page("Welcome: Mercury").ChildObjects(EditDesc)
NumberOfLists = Lists.Count()
If NumberOfLists > 0 Then 
  Browser("Welcome: Mercury").Page("Welcome: Mercury").Lists(0).Set "MyName" 
End If
  一些具體的用法可以在 QTP的幫助里面找到。 個人的建議是:你最好按照 QTP里面提供的例子,自己使用這些函數(shù)自己寫幾行語句,運行后看一下運行結(jié)果,結(jié)合QTP幫助里面的說明,這樣學(xué)習(xí)會快,也記得牢固。
  在輸出結(jié)果時, 常用的函數(shù)有 Msgbox 和 Print 函數(shù)。Msgbox 函數(shù)在 QTP8.2 及其以上版本都可以使用;Print 函數(shù)需要在 QTP 9.2 版本上使用,QTP 8.2 不支持此函數(shù),不知道 QTP 9.0是否支持此函數(shù)。
  希望大家共同總結(jié)一下,一起進步。

作者:未知 | 文章來源:未知 | 更新時間:2008-1-15 16:42:30

  • 上一篇文章:

  • 下一篇文章:

  • 相關(guān)文章:
    在C++中成員函數(shù)如何實現(xiàn)操作符重載?
    JS支 是否支持“函數(shù)重載”
    數(shù)據(jù)庫開發(fā)oracle單行字符串函數(shù)
    軟件技術(shù)
    · 開發(fā)語言
    · Java技術(shù)
    · .Net技術(shù)
    · 數(shù)據(jù)庫開發(fā)
    最新文章  
    ·搜集整理的asp.net的驗證方
    ·各種FOR循環(huán)結(jié)構(gòu)的整理
    ·軟件項目開發(fā)中應(yīng)該考慮那
    ·搜集整理的javascript sel
    ·軟件開發(fā)中項目經(jīng)理有那些
    ·學(xué)習(xí)如何在Lambda表達式進
    ·C++基礎(chǔ)知識:結(jié)構(gòu)體數(shù)據(jù)的
    ·C#實現(xiàn)短信發(fā)送程序的例子
    ·sun最近修補了一部分java的
    ·rss定制的另外一種實現(xiàn)方式
    ·delphi實現(xiàn)利用arp欺騙來實
    ·基礎(chǔ)學(xué)習(xí):基于WF的流程框
    ·網(wǎng)絡(luò)編程中怎樣得知一次數(shù)
    ·如何逆序輸出單鏈表?
    ·軟件開發(fā)過程中的性能設(shè)計
    關(guān)于我們 | 軟件開發(fā) | 下載試用 | 客服中心 | 聯(lián)系我們 | 友情鏈接 | 網(wǎng)站地圖 | 新疆電子地圖 | RSS訂閱
    版權(quán)所有 © 2016 新疆二域軟件開發(fā)網(wǎng) m.jdtbank.com All Rights Reserved 新ICP備14003571號
    新疆軟件開發(fā)總機:0991-4842803、4811639.
    客服QQ:596589785 ;地址:新疆烏魯木齊北京中路華聯(lián)大廈A-5C 郵編:830000
     
    西乌珠穆沁旗| 博客| 西乡县| 蓬莱市| 灵台县| 崇义县| 红原县| 庄河市| 巴林右旗| 岐山县| 四平市| 武义县| 天峨县| 平塘县| 辽宁省| 东阿县| 广元市| 定日县| 凉城县| 运城市| 沁源县| 肥东县| 东乌珠穆沁旗| 盖州市| 广州市| 龙口市| 榆林市| 霍林郭勒市| 玉树县| 新龙县| 肇东市| 会理县| 蛟河市| 吉安县| 远安县| 南华县| 分宜县| 永新县| 大安市| 根河市| 大石桥市|