cancel
Showing results for 
Search instead for 
Did you mean: 

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

New Member

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

2 REPLIES 2
Community Hero

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

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



Regards,
Rao.
Community Manager

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

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.

 

 

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
New Here?
Join us and watch the welcome video:
Top Kudoed Authors