GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Tech FAQs  >  QTP

 Print  |  
Question:  In a Combobox(or) ListBox there some Values ...like...1,2,3,4. Using QTP how Check these Values are ....Dislying or not...Please Can any one Give the VB Script .....



August 08, 2006 07:26:39 #1
 Hokrani   Member Since: Visitor    Total Comments: N/A 

RE: In a Combobox(or) ListBox there some Values .....
 

*1st you have to add weblist to object repository. (To add weblist to object repository, right click on the weblist and select ‘View/Add Object’ and click on ‘OK’ button )

Suppose u added Weblist in the following Tree

 Home -> Mail -> 1list

 

* Stored the expected values in localsheet(Action1)

 Suppose u stored values under ‘Input’ column under Local sheet

 

* Use the following code.

Dim counter, NumOfRow

NumOfRow = datatable.Getsheet("Action1").GetRowCount

counter=0

Do while counter<NumOfRow

 

If (datatable.Value("Input",dtlocalsheet)=Browser("Home").Page("Mail").WebList("1list").GetItem(counter) )then

msgbox "correct value"

else

 msgbox "Wrong value"

 end if

 

counter= counter+1

Datatable.SetNextRow

 

Loop

 

It will work properly. Let me know if u have any question regarding this and anything more…don’t forget mail to me @ hokrani@gmail.com.

     

 

Back To Question