Sponsored Ad

Saturday, October 9, 2010

Get Length of Given String in QTP

Steps to find number of Characters in a string:

1. Use Len() function of VBScript to calculate length of a string, it means number of characters in  string.

2. Pass the given string in this function and it will return the char count.

QTP (VBScript) Program to return number of characters in given string.

<html>
<head>
<script type="text/vbscript">

QTPLength="Software Testing Automation"
document.write("Given String is: " & QTPLength & "<br>")
document.write("Length of Given String is: " & Len(QTPLength))

</script>
</head>
</html>

Output of Length function:

Calculate Length of Given String in QTP

Where to Run This Program:

1. This VBScript Program code either you can use in QTP editor  (code between <script> and </script> tags ) and run it.

2. Write in Notepad, save with .htm extension and run on internet explorer.

0 comments:

Post a Comment

Sponsored Ad

Development Updates

Tech Updates