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 |
What is Parameterizing Tests?
wht is Manual Testing Frame work. Pls anybody can give appropriate answers
How extensive or customized are the server logging and reporting requirements; are they considered an integral part of the system and do they require testing?
How to write business scripts using object repository with different scenarios
I recorded a Web based Application running on JAVA and when I went to play them back a week later they didn't run. I noticed that the Browser was putting in a (Underscore and a Number) for each line so i re-recorded and noticed the Underscore line wasn't the same as what i recorded last week so any script I record today will not work next week because the browser settings or how QTP recognizes it keeps changing. This is the new line Browser("Bureau of Labor Statistics_4").Page("Bureau of Labor Statistics").JavaApplet("SurveyApplet").JavaList ("Select an Area").Select "U.S. city average" This is the old line 'Browser("Bureau of Labor Statistics_3").Page("Bureau of Labor Statistics").JavaApplet("SurveyApplet").JavaList ("Select an Area").Select "U.S. city average" Notice the Burearu of Labor Statistics_3 adn Burearu of Labor Statistics_4. Why does it change and how do I prevent it from changing.
How to create log file in qtp?
What is the entry and exit point of automation testing
what is localisation testing and globalisation testing? what is the difference between them?
What is chaild object method? When we will go for chaild object method? How to use chaild object method?
with out using import sheet came is it possible to get the excel sheet ?
Name the different types of recording modes?
What are the advantages of a Hybrid framework?