How does VBScript develop automated test scripts
This article will explain in detail how to develop automated test scripts in VBScript. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
I have also worked in the software testing industry for many years, and my direction is also automated testing. I am also familiar with VBScript scripts. During the testing process,
There are also some applications, so let's talk about how to use VBScript to develop automated tests.
Let's start by introducing several functions of VBScript that can be used in automated test development.
1. InStr function
Description
Returns the position where a string first appears in another string.
Grammar
InStr ([start,] string1, string2 [, compare])
The syntax of the InStr function has the following parameters:
Parameter description
Start is optional. A numeric expression that sets the start position of each search. If omitted, the search starts at the position of the first character. If start contains Null, an error occurs. If compare is specified, you must have a start parameter.
String1 is required. A string expression that accepts the search.
String2 is required. The string expression to search for.
Compare is optional. A numeric value that indicates the type of comparison used when calculating substrings. For numerical values, see the Settings section. If omitted, a binary comparison is performed.
Example:
This function describes where one string appears in another string and is often used as a comparison result in automated testing.
For example:
Dim a,b
A = "rtyi"
B = "1345krkrtyi: {">