there are having 10 checkboxes..how can i check only first
5 check boxes by using descriptive programing..
Answers were Sorted based on User's Feedback
Answer / firoz shaik
A Small correction in the above code :
set objCheckBox=Description.Create()
objCheckBox("micclass").Value="WebCheckBox"
set objChildObjects=Browser("micclass:=Browser").Page
("micclass:=Page").Childobjects(odesc)
for i=1 to objChildObjects.Count
If i=5 Then
Exit For
End If
objChildObjects(i).Set "ON"
Next
| Is This Answer Correct ? | 12 Yes | 3 No |
Answer / nuka raju
Dim objCheckbox
set objCheckBox=Description.Create()
objCheckBox("micclass").Value="WebCheckBox"
set objChildObjects=Browser("micclass:=Browser").Page
("micclass:=Page").Childobjects(odesc)
for i=1 to 5
objChildObjects(i).Checked
Next
| Is This Answer Correct ? | 11 Yes | 5 No |
Answer / mahesh
can any body pls send the code for this question
| Is This Answer Correct ? | 5 Yes | 2 No |
Answer / ramana vanteru
Hi mahesh,
ur question is not clear to me, still my ans is,
get checkbox item count using child objects and then use
For loop to get first 5 checkboxes.
| Is This Answer Correct ? | 6 Yes | 3 No |
Answer / uday
Firoz cant your for loop optimized like below:
for i=1 to 5
objChildObjects(i).set "ON"
Next
The rest is fine.
| Is This Answer Correct ? | 4 Yes | 1 No |
Answer / vishnu
// Save the below script in Htm format
<html>
<body>
<form>
YES / NO1: <input type="checkbox" name="CB1"></br>
YES / NO2: <input type="checkbox" name="CB2"></br>
YES / NO3: <input type="checkbox" name="CB3"></br>
YES / NO4: <input type="checkbox" name="CB4"></br>
YES / NO5: <input type="checkbox" name="CB5"></br>
YES / NO6: <input type="checkbox" name="CB6"></br>
YES / NO7: <input type="checkbox" name="CB7"></br>
YES / NO8: <input type="checkbox" name="CB8"></br>
YES / NO9: <input type="checkbox" name="CB9"></br>
</form>
</body>
</html>
'Descriptive Programming
'Suppose we are having 10 checkboxes..How can We check only first 5 check boxes by using descriptive programing?
SystemUtil.Run "iexplore","file:///C:/Users/Administrator/Desktop/sample.htm"
Set BP=Browser("CreationTime:=0").Page("micclass:=Page")
BP.WebCheckBox("name:=CB1").Set "ON" 'ON is used to check
BP.WebCheckBox("name:=CB2").Set "ON"
BP.WebCheckBox("name:=CB3").Set "ON"
BP.WebCheckBox("name:=CB4").Set "ON"
BP.WebCheckBox("name:=CB5").Set "ON"
BP.WebCheckBox("name:=CB6").Set "OFF" 'OFF is used to Not Check
BP.WebCheckBox("name:=CB7").Set "OFF"
BP.WebCheckBox("name:=CB8").Set "OFF"
BP.WebCheckBox("name:=CB9").Set "OFF"
| Is This Answer Correct ? | 1 Yes | 1 No |
Answer / pushpa
By using select method and index property.
.select "#0","#1",....
| Is This Answer Correct ? | 1 Yes | 3 No |
Answer / satish
set x=description.create
x("micclass").value="WinCheckbox"
set y=Browser("title:=.*).page("title:=.*").childobjects(x)
print x.count
for i=1 to 5 step 1
x(i).set "on"
next
| Is This Answer Correct ? | 0 Yes | 2 No |
Answer / pushpa
By using QTP Ordinal identifier "creationtime" like
Browser("title:=").page("title:=").WebCheckbox("Name:=',Creationtime:=0").select
| Is This Answer Correct ? | 0 Yes | 5 No |
how to test background color and dynamic images during runtime
how you will do cookie testing using QTP?
Hi, Can anyone write the following qtp script...please its urgent ·Navigate to Google in a new IE instance ·Search for the following word "Gap, Inc." ·Iterate thought the first 10 pages of google ·On each page collect the following ·The "blue" page title ·The "green" url ·Output all the data into a file named "test_output.txt" ·Format "Title – URL"
Hi Friends, Iam Beginner in QTP and i want to Try the software QTP. I checked the mercury site for QTP Trial version and i found QTP 9.0. The thing is that it supports windows 2000,Xp but not windows 98.And Iam using Windows 98 onlu and it's not possible for me to upgrade to windows 2000. Pls. guide me how to get the trial version of QTP which supports windows 98 Operating System The version may be 6.5 is ok for me.Thanks in Advance
what is error and fault in terms of software quality?
What is ObjectParamater?
If an application name changes frequently i.e while recording it has the name, in this case, how do qtp handles?
Can we do server automation by QTP? If you have any helpful links ,pls post it. Thanks Uma
what function you write to do database testing with the help of qtp?
In a web page, one web table is present which is dynamic. In that table one of the column has links with the same inner text. write a script so that i need to click the third link.
In an application you have a web table. You are provided with an external Excel sheet with the same structure as that of the web table. How will you retrieve all data from the web table and compare it with corresponding data available in the excel sheet, using QTP? How will you report the results in QTP?
How function returns a value?