In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
Editor to share with you what are the common functions of VBScript, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
1,GetROProperty
Description: You use the GetROProperty method to retrieve the current value of a test object property from a run-time object in your application.
In general, all objects can use this method to get the actual value of the run-time object.
Syntax: object.GetROProperty (Property, [PropertyData])
Such as ButtonName=Browser ("QA Home Page"). Page ("QA Home Page"). WebButton ("Submit"). GetTOProperty ("Name")
2,WaitProperty
Description: Waits until the specified object property achieves the specified value or exceeds the specified timeout before continuing to the next step.
This method can solve the problem of test object synchronization caused by waiting for the system to deal with some operations or network reasons.
Syntax: object.WaitProperty (PropertyName, PropertyValue, [TimeOut])
Such as
Window ("Test"). Static ("Status:"). WaitProperty "text", "Ready", 30000
3,Instr
Returns the position of the first occurrence of one string within another.
You can get the position where one string first appears in another string.
Syntax: InStr ([start,] string1, string2 [, compare])
4,Split
Returns a zero-based, one-dimensional array containing a specified number of substrings.
This function can split a string that was originally concatenated with a special string to get an one-dimensional array.
5,UBound
Returns the largest available subscript for the indicated dimension of an array.
Get the maximum value of a dimension.
6,Trim
Returns a copy of a string without leading spaces (LTrim), trailing spaces (RTrim), or both leading and trailing spaces (Trim).
If you need to remove all spaces to the left of the string, you can use the LTrim function; if you need to remove all spaces to the right of the string, you can use the RTrim function. If you need to remove all spaces on the left and right side of the string, you can use the Trim function.
7,Ucase
Returns a string that has been converted to uppercase.
This function converts all characters to the corresponding uppercase.
8,LCase
Returns a string that has been converted to lowercase.
This function converts all characters to the corresponding lowercase.
9,Cstr
Returns an expression that has been converted to a Variant of subtype String.
Since VBScript has only one type Variant, you can use this function to cast a variable to a String type.
10,CInt
Returns an expression that has been converted to a Variant of subtype Integer.
Since VBScript has only one type Variant, you can use this function to cast a variable to an Integer type.
In descriptive programming statements, the most commonly used functions are:
11,Create
This is the method that must be used when creating a class or an object.
12,ChildObjects
Using this method, you can get a collection of a class of objects that meet certain conditions.
13,Count
Using this method, you can get the number of a class of objects that meet certain conditions.
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
Some specific uses can be found in the help of QTP. Personal advice is: you'd better follow the example provided in QTP, use these functions to write a few lines of statements by yourself, and take a look at the results after running, combined with the instructions in QTP help, so that you can learn quickly and remember firmly.
When outputting the results, the common functions are Msgbox and Print functions. The Msgbox function can be used in QTP8.2 and above; the Print function needs to be used on QTP version 9.2, and QTP8.2 does not support this function. It is not known whether QTP 9.0 supports this function.
These are all the contents of the article "what are the common functions of VBScript?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 214
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.