Dim a
a=Mid("qtp",2)
msgbox a
Output-tp
Dim a
a=Mid("Testing",1,4)
msgbox a
Output-Test
Dim a
a=Mid("Software Testing",10,7)
msgbox a
Output-Testing
qtp script to return specified number of characters from a string-VBScript Mid Function example-vbscript function commands-scripts in QTP-QTP Scripts
qtp script to print odd numbers-script in qtp to print odd numbers from 1 to 10-basic qtp scripts for beginners-qtp sample examples-qtp scripts-qtp
dim i
for i=1 to 10
if (i mod 2<>0) then
msgbox i&"is odd number"
end if
next
above example prints odd numbers from 1 to 10.
QTP Script to Insert Values Into Database Table-Script for Inserting values in database table in QTP
VBScript to insert values in database table.
We have table "EMP" in database "db"(Microsoft Access).
EMP Table has following data in it.
EMPNO EMPNAME EMPSAL
1 Lakshmi 30000
2 Laxmi 25000
3 Latha 15000
Check This Blog For SQL Queries
Check this post for Script to get column names from database table(MS Access).
Dim con,rs
set con= CreateObject( "ADODB.Connection")
set rs =CreateObject("ADODB.Recordset")
con.provider="microsoft.jet.oledb.4.0"
con.open"d:\db.mdb"
rs.open "insert into EMP(empno,empname,empsal) values(4,'Lakshmi',40000)",con
msgbox("Inserted")
Above script(code)will insert values in database table.
Output:
EMPNO EMPNAME EMPSAL
1 Lakshmi 30000
2 Laxmi 25000
3 Latha 15000
4 Lakshmi 40000
QTP Script to count no. of checkboxes in a webpage
SQL Queries Collection
QTP Script for Connecting to database
QTP Script to export database data to excel sheet
QTP Script to import database data to datatable
Connecting to MSAcess,Oracle,SQL Server Database
Hindi and Telugu Songs Lyrics
QTP Script to get column names from database table(MS Access).
Navigation To Get Line Numbers In Expert View
Follow below navigation to get line numbers in expert view(QTP).
Tools -> Editor Options -> General tab -> Check show line numbers check box and click on OK button.
Data Driven Testing
SQL Queries Collection
Movie Songs Lyrics
QTP Faqs
SQL Faqs