Forum Discussion

gdave's avatar
gdave
Regular Contributor
4 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

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.

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 gdave 

     

    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