Hi ,
Can you any body please provide clarification for the below two Issues:
Issue1:
How to know whether the the child grid((Toogle Tree(+)) is expanded or not(When grid is having Parent Nested Grids). I am able to get the status of the Parent grid expandable status using the below code snippet:
'Verify Toggle row is Expanded or Not
Dim strToogleStatus AS String
strToogleStatus = AMS_Globalvariables.objUltra.GetNAProperty("Rows[0].Expanded")
If AMS_Globalvariables.strresult = "True" Then
LogTestResult("Successfully Expanded the Parent grid Premises Row", True)
Else
LogTestResult("First row of Premises grid is not Expanded", False)
End If
In the above code i am verifying the expandable property of the parent grid row only. However i need to verify the status for Expanded property for the child grid rows (We have multiple Nested child grids in the winform). Please provide the sample code snippet to get the nested child grid rows(Toogle Tree(+)) expanded property.
Issue2:
How to Get the selected value from the UltraDropDown list using GetNAproperty().
Our requirement is as Below:
Step1: Click on Subjcet of Insurance Drop Down and Type in Coverage 'Golf Course'.
Expected: You will see the list scroll to that Typed Coverage.
We need to verify that the typed coverage is selected in the Drop Down. Plesae provide sample code snippet.
Thanks & Regards,
Vijay Jadi.
Hi Vijay,
Each row in the grid root band collection can have one or more child bands. so for example lets say you only have one child band. and you need to check the expanded property value of the first child of the first row, then you'll call this:
strToogleStatus = AMS_Globalvariables.objUltra.GetNAProperty("Rows[0].ChildBands[0].Rows[0].Expanded")
and to get the expanded property for the first child row for the second row:
strToogleStatus = AMS_Globalvariables.objUltra.GetNAProperty("Rows[1].ChildBands[0].Rows[0].Expanded")
UltraComboEditor1ComboBox().Click(AtPoint(18,9))Form1Window().InputChars("Golf Course")LogTestResult("AutroSelct", CStr(UltraComboEditor1ComboBox().GetNAProperty("SelectedItem.DisplayText")) = "Golf Course")
That should do it for your test case
Regards,
Ammar
Hello Ammar,
Thanks for the code snippet you have provided.
Issue1: It is working fine with code you have provided.
Coming to Issue2: It throws an exception with the property ("GetNAProperty(SelectedItem.DisplayText")). Exception message is as "SelectedItem property not found".
Actually here we have to validate for the 'UltraDropDown' Combo box which is embeded in 'UltraWinGrid'
Drop Down Test Object Class Name: UltraDropDownTestObject
So, Please provide the specific UltraDropDown object related property to verify the selectedItem(Display Text) in Drop Down.
Also, let me know how to verify the 'UltraDropDown' is Drop or Collapse(Expanded/Collapsed), respectively when Press Alt -down/up on a drop down.
I'm glad that I was able to help. :)
Please let me know if you need anything else.
-Ammar
Hello Amar,
Thanks for the information and code snippet. Its working fine.
Vaijy jadi.
To get information on the selected row you can use:
UltraGrid1Table().Click(AtList(AtCell( _ AtRow("Column 0", "A"), _ AtColumn(AtText("Column 1"))), _ AtLocation("DROPDOWN")))Form1Window().InputChars("Bo")LogTestResult(CStr(UltraDropDown1Table().GetNAProperty("SelectedRow.Cells[0].Text")), True)
YOu can access any cell on the selected row in the same way.
"IsDroppedDown" is the property to let you know if the control is openned or closed:
MsgBox(CStr(UltraDropDown1Table().GetNAProperty("IsDroppedDown")))
Please note that if the drop down is embedded inside a grid and is not visible (i.e. not dropped down) then RFT will not be able to find the testobject and will throw Rational.Test.Ft.ObjectNotFoundException when you try to use the test object. so the best way to verify if the dropped down is visible or not in this case is to have the action ina Try catch block and if the exception is ObjectNotFoundException thne you know that the drop down is not visible.
By that way, you can go to help.infragistics.com and search the API references for controls properties and their values. Basically the control name is the same as RFT test object without the "TestObject" so for "UltraDropDownTestObject" you need to look for "UltraDropDown"
Regards,Ammar