01-06-2010, 07:07 PM
Hi Saket
Here I go , lot many questions and lot many doubts :
Looking at your reply I have tried these combinations. But nothing seems to be working properly:
1) Using Child Object mthod:
The above statement throws me an error
2) Using descriptive programming
The above code works fine . But, it checks all the checkboxes irrespective of the color mismatch.
3) Getting Child Object
Please guide me which approach would be helpful and how to go with it ???
Thanks
Swetha
Here I go , lot many questions and lot many doubts :
Looking at your reply I have tried these combinations. But nothing seems to be working properly:
1) Using Child Object mthod:
Code:
Dim obj_checkDesc, allchkvalues, singlechkvalue
[i]'Webelement description object[/i]
Set obj_checkDesc = Description.Create
obj_checkDesc("html tag").value = "TD"
obj_checkDesc("height").value = "23"
[i]'using the class name as object is in theChidItem Method[/i]
For i = o to 5
set a = browser("TalonPro Solutions").Page("TalonPro Solutions_2").Frame("Frame").WebTable("Property_2").ChildItem(2,7,obj_checkDesc, i)
msgbox a.currentStyle.backgroundColor
Next
2) Using descriptive programming
Code:
i= 2
[i]'Checking the existance od checkbox in each row [/i]
Do While Browser("TalonPro Solutions").Page("TalonPro Solutions_2").WebCheckBox("html tag:=INPUT","type:=checkbox", "index:="&i).Exist
[i]'Checking the webelement in each column [/i]
For j = 5 to columcount
objcolor = browser("TalonPro Solutions").Page("TalonPro Solutions_2").Frame("Frame").WebTable("Property_2").webelement("html tag:=TD","height:=23","index:="&j).Object.currentStyle.backgroundColor
msgbox objcolor
If objcolor <> vacantcolor Then
Exit for
else
End If
[i]'Check box checked after ecah column check[/i]
Browser("TalonPro Solutions").Page("TalonPro Solutions_2").Frame("Frame").WebTable("Property_2").WebCheckBox("html tag:=INPUT","type:=checkbox", "index:="&i).set "ON"
Next
3) Getting Child Object
Code:
Dim obj_checkDesc, allchkvalues, singlechkvalue,objcolor
Set obj_checkDesc = Description.Create
obj_checkDesc("html tag").value = "TD"
obj_checkDesc("height").value = "23"
obj_checkDesc("outerhtml").value = ".*BORDER-RIGHT: 1px solid.*"
[i]'used this to get the child objects [/i]
Set allchkvalues = browser("TalonPro Solutions").Page("TalonPro Solutions_2").Frame("Frame").WebTable("Property_2").ChildObjects(obj_checkDesc)
[i]'Webelement count [/i]
countweb = browser("TalonPro Solutions").Page("TalonPro Solutions_2").Frame("Frame").WebTable("Property_2").ChildItemCount(5,8,"WebElement")
msgbox countweb
[i]' countweb: This always shows '0' value[/i]
For i = 0 to countweb
objcolor = browser("TalonPro Solutions").Page("TalonPro Solutions_2").Frame("Frame").WebTable("Property_2").webelement(obj_checkDesc,"index:="&i).Object.currentStyle.backgroundColor
msgbox objcolor
Next
Thanks
Swetha