Forum Discussion

Jhansee's avatar
Jhansee
Occasional Contributor
14 years ago

Property Changes dynamically for Read Only field under grid in row

Hi,

Generally we are using Obj_ReadOnly function inorder to find whether the field is Read Only field or not. Code has written below


Sub Obj_ReadOnly


Set Test_Obj=T1


  If (BuiltIn.VarToStr(Test_Obj.ReadOnly))=Test_Value Then


           If
TC_Result="FAILED" Then


                   TC_Result="FAILED"


            Else                                    


                   TC_Result="PASSED"


           End If


 
Else


           Log.Message
Test_Obj.ReadOnly

End If

End Sub

First It will check object in Obj_Exists then it will come to Obj_ReadOnly function.It works fine for All fields except fields which are under grid in row. If we want check field as Read Only under grid in row, the above is not working because for grid we are using "checking" function and it doesnt have component type so, it fails in Obj_Exists itself. In order to overcome this I have taken other function call Obj_viewOnly and checking with Obj State Value. But it is changing dynamically like selectable focusable, focused selected selectable etc.

Could you give any Alternate solution for this

Thanks in advance

K.Jhansi

1 Reply

  • irina_lukina's avatar
    irina_lukina
    Super Contributor

    Hi Jhansi,


    As far as I understand, you need to determine whether a cell of the tested grid is read-only, don't you? If you do, please clarify some questions:

    1. Which version of TestComplete are you using?

    2. Which control are you testing?

    3. What do you mean when you say:

    But it is changing dynamically like selectable focusable, focused selected selectable etc.


    If I get you wrong and you need to perform another task, please describe it in detail.


    Thanks.