QTP Script To Count no. of Checkboxes and to Check All Checkboxes in a Webpage

59
rate or flag this page

By snigdha_123

QTP Script to count no. of checkboxes in a webpage

QTP Script to count no. of checkboxes in a webpage(pingomatic.com).

Set a=Description.Create
a("html tag").value="input"
a("type").value="checkbox"

Set b=Browser("name:=Ping-o-Matic!").Page("title:=Ping-o-Matic!").childobjects(a)
c=b.count
msgbox c

Check here for Data Driven Testing QTP


Software Testing (2nd Edition) Software Testing (2nd Edition)
Price: $29.13
List Price: $49.99
Agile Testing: A Practical Guide for Testers and Agile Teams Agile Testing: A Practical Guide for Testers and Agile Teams
Price: $36.98
List Price: $49.99
Testing Computer Software, 2nd Edition Testing Computer Software, 2nd Edition
Price: $34.99
List Price: $70.00
Software Testing: Fundamental Principles and Essential Knowledge Software Testing: Fundamental Principles and Essential Knowledge
Price: $14.99
List Price: $14.99
Lessons Learned in Software Testing Lessons Learned in Software Testing
Price: $22.30
List Price: $39.99
Software Testing: A Craftsman's Approach, Third Edition Software Testing: A Craftsman's Approach, Third Edition
Price: $79.96
List Price: $99.95

QTP Script to Check All Checkboxes in a Webpage

QTP Script to Check All Checkboxes in a Webpage.

Set a=Description.Create
a("html tag").value="input"
a("type").value="checkbox"

Set b=Browser("name:=").Page("title:=").childobjects(a)
c=b.count
msgbox c

For i=0 to c-1
b(i).set "on"
Next

QTP Faqs


QTP Scripts

 Script for copying a file from One Folder to Another Folder in QTP?

Dim f
Set f = CreateObject("Scripting.FileSystemObject")
f.CopyFile "C:\lakshmi.txt", "D:\"
Msgbox "File Copied"

Above script is for copying a text file(lakshmi)from C drive to D drive.

The CopyFile method,performs the file copy operation.

The CopyFile method takes two parameters,the source file and the destination.

 

Script to Copy a folder from one drive to other in QTP.

Dim f
Set f = CreateObject("Scripting.FileSystemObject")
f.CopyFolder "D:\Test2", "C:\"
Msgbox "Folder Copied"

Above script is for copying a Folder(Test2)from D drive to C drive.

The CopyFolder method,performs the folder copy operation.

The CopyFolder method takes two parameters,the source folder and the destination

 

Print   —   Rate it:  up  down  flag this hub

Comments

RSS for comments on this Hub

syam  says:
6 months ago

What is the script to count no of text boxes in web application(ex:userid, password)?

Syam  says:
5 months ago

Set ee=Description.Create

ee("html tag").value="input"

ee("type").value="Radio"

Set RadioButton_collection=Browser("name:=google.*").Page("title:=google.*").childobjects(ee)

print "Number of Radio Buttons:"&RadioButton_collection.count

Submit a Comment
Members and Guests

Sign in or sign up and post using a hubpages account.


optional


  • No HTML is allowed in comments, but URLs will be hyperlinked
  • Comments are not for promoting your hubs or other sites

working