Forum Discussion

s5h's avatar
s5h
Contributor
12 years ago

Code Expression Syntax for appending parameters

Hi 



So I have a If.. Then statement, in value1  have 

Aliases.QAD_Client.ShellForm.MdiClient.DPaymentSelectionForm.ScBasicForm_Fill_Panel.controlPanel.detailGrid.detailGrid.Rows.Item(Project.Variables.RowIndex).Value



Now I would like to be able to pass the part: 

Aliases.QAD_Client.ShellForm.MdiClient.DPaymentSelectionForm.ScBasicForm_Fill_Panel.controlPanel.detailGrid.detailGrid 

as a parameter rather than hardcoded so I was trying something like 



KeywordTests.Test1.Parameters.objgrid +.Rows.Item(Project.Variables.RowIndex).Value Equals stritem

as a code expression but this doesn't seem to work. 

I'm sure it is only a syntax error. 

But it would be great if I could get this working 



Thanks for any help :)




  • Hi Siobhan,


     


    If Aliases.QAD_Client.ShellForm.MdiClient.DPaymentSelectionForm.ScBasicForm_Fill_Panel.controlPanel.detailGrid.detailGrid is stored in the objgrid test parameter, so, I guess, you need to use the following line to get the value of the item:


    KeywordTests.Test1.Parameters.objgrid.Rows.Item(Project.Variables.RowIndex).Value


     

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Siobhan,


     


    If Aliases.QAD_Client.ShellForm.MdiClient.DPaymentSelectionForm.ScBasicForm_Fill_Panel.controlPanel.detailGrid.detailGrid is stored in the objgrid test parameter, so, I guess, you need to use the following line to get the value of the item:


    KeywordTests.Test1.Parameters.objgrid.Rows.Item(Project.Variables.RowIndex).Value


     

  • s5h's avatar
    s5h
    Contributor
    Hi Tanya 



    Thanks for your reply 



    I tried your suggestion and it does not seem to append the parameter to .Rows.item 



    For examle if I have KeywordTests.Test1.Parameter.obgrid.Rows.Item(Project.Variables.RowIndex).Value



    The result of running this is blank. But if I have the hard coded grid object like 



    Aliases.QAD_Client.ShellForm.MdiClient.DPaymentSelectionForm.ScBasicForm_Fill_Panel.controlPanel.detailGrid.detailGrid.Rows.Item(Project.Variables.RowIndex).Value



    The correct value gets returned 



    This is something we would use to make tests reusable with different grids so hopefully we can get it working with your help :)