Forum Discussion

jerome69's avatar
jerome69
New Member
9 years ago

I didn't retrieve my property's value from context

Hello,


In a first groovy script of my TestCase I put the value in the context :

mailAddress="mymail@gmail.com"
log.info ">> "+mailAddress
context["MailIdentifier"] = mailAddress

And I try to retrive in a second groovy script :

myMail=context.getProperty("MailIdentifier")


but the value is null...
What's the matter ??? How to use the correct context variable ?
thanks

  • nmrao's avatar
    nmrao
    Champion Level 3

    May be you want to try below in order to add to context?
    context.MailIdentifier = 'mymail@gmail.com'

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Jerome69,

     

    Your Groovy scripts can have different values in the context object. I suggest that you use project properties to share data between your test steps.