There is a web Table where You will find Two Columns
First Column consist of Check box and Second column consist
of Test cases ID(Viz T1,T2,T3....Etc); If You select any
Test case ID, respective Check boxes to be checked write a
VBSCRIPT for this scenario?



There is a web Table where You will find Two Columns First Column consist of Check box and Second ..

Answer / prathibha

rc=Browser().Page().webtable().rowcount

for i=1 to rc

cc=Browser().Page().webtable().columncount(i)

for j=1 to cc

if Browser().Page().webtable().getcelldata(r,c)="T1" or "T2" or "T3" then

set Owebchkbox=Browser().Page().webtable().getchilditem(r,c,"webcheckbox",index:=0)

Owebchkbox.set "on"

end if

next

next



Steps:- 1.Intially I'm trying to find the rowcount

2.iterate the no.of rows we have

3.find no.of columns we have for the row

4.iterate that from starting column with that row

5.find cell data value with getcelldata(r,c)="T1"or "T2"..etc

6.when it matches at that point get the childitem object with that row and column corresponding to the row and column no.where we had matched T1 or T2 ...

7.After obtaining the child item object ..do the necessary operation on it .like in our case we have to set it to on

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More VB Script Interview Questions

who will create the object?

0 Answers   TCS,


How to Import data from a file (file is on the desktop) to the data table

0 Answers   IBM,


How can you create a file object to work with the files in the vbscript language?

0 Answers  


What is sql loader? Explain the files used by sql loader to load file?

0 Answers  


how does vb script help in web page designing? explain with example.

0 Answers  






what is the differance between BYVAL,BYREF?

0 Answers  


Hello All, In QTP 9.2 for Mozilla Firefox, there is webelement in my application, I tried to click on that using decsriptive programming, but it does not work. and for this i tried this code too: Set obj = CreateObject ("Mercury.DeviceReplay") absx = Browser("").Page("").WebElement(".").GetROProperty ("abs_x") absy = Browser("").Page("").WebElement(".").GetROProperty ("abs_y") obj.MouseMove absx, absy obj.MouseClick absx, absy, 0 But it is not clicked. Can anyone help me out for this problem. Thnx in Advance

1 Answers  


A folder is there inside no of textfiles are avilable. How do count the textfiles. Normally folder means we are using subfolder methods but textfiles is not working for subfolder methods and how do get file name also.

0 Answers  


Hi Friends, I have an issue like the describe below: I'm using QTP and I'm testing on SharePoint. As you knoe, SharePoint has a customize function for user, so that, If I add an object Web Table at the first time, that object was recognized by "index" and "html tag", after that, if someone change the display of web part, the "Index" of my object was changed as well and QTP unable to select that Web Table. Can you guide me how to identify or anyway to keep that Web Table object as unique object? Thanks a lot.

0 Answers   CSC,


Plzzzzzzz can any one tell me which is the best institute in hyderabad for learing VBScript. plz do answer guys its urgent plzzzzzzz. thanks in advance.

0 Answers  


how to write code: to check whether the window of an Application Under Test exist or not . plz give with example

2 Answers  


I need help to write a function in vbscript to click on a link. That link looks like a tab. There are 6 tabs. When I click on 1 tab it should show as "on". when I spy the class property is on. But for the one which is not clicked the class property is blank. I have objects created in our custom object repository. Please give me some idea.

1 Answers  


Categories