Exforsys

Free Training

Funtion to get the status of the check box along with name of the web element

This is a discussion on Funtion to get the status of the check box along with name of the web element within the Software Testing forums, part of the Testing category; Hi everyone, Please help me in writing a function in QTP. I am testing a web page which has so ...

Go Back   Exforsys > Testing > Software Testing

Exforsys.com


Software Testing Software testing is a process used to identify the correctness, completeness and quality of developed computer software.

Reply

 

LinkBack Thread Tools Search this Thread
  #1 (permalink)  
Old 04-20-2009, 07:33 PM
Junior Member
 
Join Date: Aug 2008
Posts: 1
thequestionboy is on a distinguished road
Funtion to get the status of the check box along with name of the web element

Hi everyone,

Please help me in writing a function in QTP. I am testing a web page which has so many check boxes (more than 50) with different name for each check box like chkbox_1, chkbox_2, chkbox_3 and so on. I writing a function to check the status of the check box (Checked or Unchecked) along with the name of the check box (like chkbox_1, chkbox_2).

I am able to get the status of the check box in the output but I am not able get the name of the check box in the output using the below function.

Public Function FindWebTable(ByVal sBrowserName, ByVal sPageName,ByVal sWebTableName)
Set oDesc2 = Description.Create()
oDesc2("micclass").Value = "WebTable"
oDesc2("name").Value= sWebTableName

Set WebTableCount=Browser("title:="&sBrowserName).Page("title:="&sPageName).WebTable("name:="&sWebTableName)
Rows=WebTableCount.RowCount
msgbox Rows

For i = 1 To Rows - 1
WebCheckBoxName=WebTableCount.GetCellData(i,2)
Reporter.ReportEvent micDone,"Name of the Check Box=",WebCheckBoxName
Next

End Function


Please let me know where am I doing wrong, I would appreciate if any one can help me in writing this function.

Thanks a lot in advance.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-03-2009, 04:19 AM
Junior Member
 
Join Date: Jul 2009
Posts: 12
basanth27 is on a distinguished road
I am still unsure how you are getting the status of the checkbox.

The function you have written is to fetch the data value in the specified column in a webtable iterating through the row loop.

When you have multiple checkbox in a webtable here is the logical approach,

1. Checkboxes are child objects to the Parent Webtable.
2.Find the count of the childitems. [ In this case checkboxes ]
3. Loop through the count to find out the "Text" & "Status" of the checkbox.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
qtp, quality assurance, software testing, vb script

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
RPN/RPL Calculator implementations, list of, regular post [long, FAQ] Craig A. Finseth Tech FAQ 0 06-14-2004 10:34 AM
comp.lang.c Answers to Frequently Asked Questions (FAQ List) Steve Summit Tech FAQ 0 06-01-2004 07:00 AM
comp.cad.autocad AutoLISP FAQ (part 2/2) - samples, code Reini Urban Tech FAQ 0 06-01-2004 06:30 AM
comp.cad.autocad AutoLISP FAQ (part 2/2) - samples, code Reini Urban Tech FAQ 0 05-01-2004 06:30 AM
RPN/RPL Calculator implementations, list of, regular post [long, FAQ] Craig A. Finseth Tech FAQ 0 04-12-2004 10:27 AM


All times are GMT -4. The time now is 06:22 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0
Copyright 2004 - 2009 Exforsys Inc. All rights reserved.