Forum Discussion

sridharp_mcf's avatar
sridharp_mcf
Contributor
15 years ago

How to change the mapped object properties during test run time through VB script

Hi



In my application a page shows records in grid table, end of the every row has edit and delete icons to edit/delete records, when we want a add a record, a new row will be added below the grid table after clicking on the add button. we can enter values and save the new record with a save button which is placed end of the new row.



We are using Test Complete 7.0 version.,   Test fail to run the recorded add operation  cause of changing in cell row index  property value.



If  cell Row index value is 4 while recording add operation Cell1(4,0), Cell2(4,1), Cell3(4,2)..............,   Now the newly added row Cell RowIndex value getting increase by 1, i.e, Cell1(5,0), Cell2(5,1), Cell3(5,2)....



Here I wants to change the Cell Object Row Index value through script during run the test  with out manual interaction and with out using Update mapping during Runtime wizard,  



 I tried with "SetPropertyValue" method



 aqObject.SetPropertyValue("Cell1", "RowIndex", 5)



but its not working.    Please any one help me in this regard its very urgent . How to change an object property value during run time. In QTP Automation Test tool there is a command 'SETTOPROPERTY' to set a required value to a particular test object...  like the way is there any command to do this. 



I would be great full to help in this..



Thanks in Advance

Sridhar P






5 Replies


  • Hi Sridhar,





    Well, you can change recognition criteria in Name Mapping during test run, actually. To do this, you need to specify a project variable instead of a constant property value in your name mapping scheme and change the variable's value during the test (you may need to call the RefreshMappingInfo method to make TestComplete update the tree after the property is changed). 





    However, if you need to identify an object regardless of its position in the objects tree, I recommend that you use the Extedned Find feature instead of changing recognition criteria dynamically. Please see the "Using Extended Search Criteria for Mapped Object Identification" help topic ( http://www.automatedqa.com/support/viewarticle/12466/ ) for more information.




  • During test run YOU CANN'T change properties of object(-s) or chage NameMapping



    GL Hf :)
  • Hi Allen, 



    If I'm wrong please correct me



    Do you offer for real-time changе of NameMapping use Variable which link to object in NameMapping ?



    Ok, And What I need to do for real-time changе of NameMapping in another project? Again create variables?



    I have one thousand variables, It's just a little bit difficult))

  • Hi Nikita,





    Yes, I refer to changing recognition criteria during script execution. In the Edit the Property Value dialog which appears if you select a mapped property value in your Name Mapping scheme and press the ellipsis button, you can define a project variable instead of a constant (see the "Edit the Property Value Dialog" help topic (http://www.automatedqa.com/support/viewarticle/12855/) for more information). If you change the value of the variable during your script execution and call the RefreshMappingInfo method, TestComplete will use the new recognition criteria and change the object reference. However, you can only use project variables defined in the current project (that is, in the project in which the Name Mapping scheme resides) for this.





    If you have a feature request or a specific suggestion regarding this functionality, feel free to share it with us and we'll consider your suggestion.


  • rajesh_chidamba's avatar
    rajesh_chidamba
    Occasional Contributor
    Hi Staff



    Have you got any updates on the below request, this is a very important feature which would help us solve a lot of issues without holding mutiple objects in the repository we could re-use the same object and try to re-use them.this approach would help us solve Flex related object issues much. please let us know, the use of name mapping is this i hope.



    Thanks

    RC