Forum Discussion

G-wagon's avatar
G-wagon
Frequent Contributor
5 years ago

Copying variable

Hi all

 

This is what my test is suppose to do:

Copy the object property value in the project level variable

gdave_0-1621592579428.png

Then use the property checkpoint to validate the above variable. However, my checkpoint failed as the variable stored at the project level is with closing brackets. Even though I have used the 'Contains' condition, it still doesn't ignore the  "()" sign.

gdave_1-1621592896701.png

I wonder if there is a way I can get rid of "()" when the variable is originally stored ? Alternatively, is there a way I can ensure that "()" is ignored when I perform property checkpoint.

 

Your response is much appreciated.

 

Thank you.

10 Replies

  • Hi G-wagon 

     

    Is the project variable being populated by a code or keyword operation in some other test, or manually populated?

    To remove characters like this I think you would need to create a small script routine to take the Project variable value and strip the brackets before it checks, like this : 

     

     

    def StripBrackets():
          
        aqObject.CheckProperty(Aliases.browser.yourPage.textnode, "contentText", cmpContains, Project.Variables.valueWithBrackets.strip("()"))

     

     

    Let me know if this helps or if I can provide another solution perhaps.

     

    thanks

    Mike

    • G-wagon's avatar
      G-wagon
      Frequent Contributor

      Thanks.

       

      The project variable is populated by keyword operation in some other test.

    • G-wagon's avatar
      G-wagon
      Frequent Contributor

      This is what I have got and somehow I am not able to make it work.

       

      qObject.CheckProperty (Aliases.browser.pageTransact.frameMain.formOmView.panel.cell3, 'contentText', 6, ProjectSuite.Variables.TotalWithdrawalAmount_InThisInstruction, true)

       

       

      • Marsha_R's avatar
        Marsha_R
        Icon for Champion Level 3 rankChampion Level 3

        Is it always 2 places after the decimal?