国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > VBScript > 正文

VBScript 常用函數(shù)總結(jié)

2019-10-26 18:03:03
字體:
供稿:網(wǎng)友
下面是我總結(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)絡原因引起的測試對象同步問題。

  語法: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)換成相應的大寫。

  8,LCase

  Returns a string that has been converted to lowercase.

  此函數(shù)可以把所有的字符都轉(zhuǎn)換成相應的小寫。

  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類型。
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表

圖片精選

主站蜘蛛池模板: 建水县| 建德市| 通河县| 和平县| 沽源县| 江北区| 桂东县| 绥棱县| 东宁县| 云和县| 永兴县| 广水市| 麻江县| 花垣县| 无为县| 寿宁县| 涿鹿县| 南丰县| 广西| 安陆市| 金山区| 汝城县| 建昌县| 连平县| 衡山县| 大荔县| 多伦县| 三明市| 仪征市| 六枝特区| 米易县| 涞水县| 巨鹿县| 平塘县| 新乐市| 嘉祥县| 潞西市| 兴化市| 得荣县| 集贤县| 沾益县|