How can we use regular expressions for a table in web page,
each cell in table having unique identification, Now I want
to count number of rows in table and enter data in all
cells of the table?



How can we use regular expressions for a table in web page, each cell in table having unique ident..

Answer / ips

intRowCnt=Browser("Google").Page("title:=.*").WebTable(“name:= TTable").RowCount
For r=1 to intRowCnt
‘’ This will loop through each row and tell count of column in each row.
intColCnt=Browser("Google").Page("title:=.*").WebTable(“name:=TTable").ColumnCount(r)
MsgBox intColCnt

for c=1 to intColCnt
Browser("Google").Page("title:=.*").WebTable("WebTable").ChildItem(r,c,"WebList",0).Select strType
or
Browser("Google").Page("title:=.*").WebTable("WebTable").ChildItem(r,c,"WebEdit",index).Set strNumber
Browser("Google").Page("title:=.*").WebTable("WebTable").ChildItem(r,c,"WebCheckBox",index).Set strPreferred

Next
Next

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More QTP Interview Questions

how to invoke the web application through script in qtp

11 Answers   IBM,


hi i have one issue while automating the script using QTP i want scrool down .i cannot do even using scrool down methqad is not working .the object will take WebElement plz is there any code help me

3 Answers  


There is an excel file of 1 to 100 sheets how you will iterate through it?

0 Answers  


I have two actions in my QTP test and two iterations in my DataSheet. I want to execute the Action 1 for the two iterations only after which i want to exceute the next Action2. How is this possible?

4 Answers  


What is a Dictionary object in QTP.?

1 Answers   Cap Gemini,






what is Defect density, defect leakage, defect age,latentbed,yasid testing, interface

4 Answers   Syntel,


How you automate test scripts

1 Answers   Novartis,


Why use Regular Expressions?

1 Answers  


Describe the differences between functions and actions in UFT?

0 Answers  


Write the code for,In the page screen we have total 10 Links,out of these I have to click 9th link

0 Answers  


what is the diff between Procedure and function

3 Answers   iFlex,


QTP is used better in which type of application Web based application or desktop application

3 Answers  


Categories