QTP Script To Count Number Of Buttons In a Webpage-QTP Scripts-QTP Script To Count Number Of Checkboxes In a Webpage

Script to count no. of buttons in a webpage in Quick Test Professional(QTP).

Check here for QTP Script to count no. of checkboxes in a webpage.

Ex 1:

SystemUtil.Run"www.google.com"
Set g=Browser("name:=Google").Page("title:=Google")
Set aa=description.Create
aa("html tag").value="INPUT"
aa("type").value="submit"
Set bb=g.childobjects(aa)
cc=bb.count
msgbox "number of buttons in a webpage=" & cc


Ex 2:

SystemUtil.Run"www.yahoomail.com"
Set g=Browser("name:=Yahoo! Mail: The best web-based email!").Page("title:=Yahoo! Mail: The best web-based email!")
Set aa=description.Create
aa("html tag").value="INPUT"
aa("type").value="submit"
Set bb=g.childobjects(aa)
msgbox "number of buttons in a webpage=" & bb.count

Check here for QTP Script to count no. of checkboxes in a webpage.
SQL Queries Collection
Movie Songs Lyrics
VB Script to insert values into database table in QTP
QTP Script to delete a particular row in an excelsheet.

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).

QTP Script to Delete Database Data-Deleting Database Table Data Through QTP

VBScript to delete a single row 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 "delete from EMP where empsal=15000 ",con

msgbox("Deleted")

Above script(code)will delete a row in database table(empsal=15000).

Output:

EMPNO EMPNAME EMPSAL
1 Lakshmi 30000
2 Laxmi 25000


To Delete all rows in database table just modify sql query as shown below

rs.open "delete from EMP where empsal=15000 ",con

Replace with

rs.open "delete from EMP ",con in the above code and the output will be

Output:

EMPNO EMPNAME EMPSAL


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).

Related Posts Plugin for WordPress, Blogger...