Email Recipients Delimiter

Hi,

We are looking to use global variable in execution profiles to include different list of email recipients. E.g. using ${GlobalVariable.EmailRecipients}

However, by passing a string defined in the execution profile, e.g. “email1@example.com;email2@example.com”, there is an error as below:
“javax.mail.internet.AddressException: Illegal semicolon, not in group in string “email1@example.com;email2@example.com” at position 18”

Is there a way to escape the semicolon character in this case or pass in multiple email addresses using execution profile’s global variable?

We are using execution profile instead of test suite level to define list of email addresses for maintainability.

Thanks in advance!

Is your GlobalVariable.EmailRecipients of type String?

You can change the type of the GlobalVariable to List instead of String.

I think List would be better suited for your case.

If you use List type, you do not have to worry about delimiters ;

Hi kazurayam,

Yes it is of type String.

I have tried using List as well and it does not recognise the list as a list of email addresses. I used a list to contain 2 strings of email addresses. Error as follows:
javax.mail.internet.AddressException: Illegal address in string “[email1@example.com,email2@example.com]”

Seems like the Katalon Email Recipient field is taking any input as a literal string.

Appreciate your response.

I suppose your Test Case script is reading the String value of the GlobalVariable.EmailRecipients which you defined it to be a List.Your code is wrong.You need to change the Test Case script so that it reads each entries of GlobalVariable.EmailRecipient as List.If you want to me to tell more, please share your Test Case script. I was wrong. I was off the point.

Following is the screenshot for the field in Project Settings > Email:
image

I used the “Send test email” to verify if email can be sent and the following is the error dialog produced:

Would my test case script affect this portion as no actual test cases have been run using this testing of sending email?

I have never used the feature configured by “Settings>Email”. So I am not sure…


I could reproduce your problem on my PC.

I tried setting GlobalVariable.EmailRecipients with value

email1@example.com;email2@example.com

. I got the error as @zy_user saw.

I tried also setting GlobalVariable.EmailRecipients with value

email1@example.com

. I mean, a single Mail address. It ran.

Surprising enough, you will get error if you set 2 or more Email addresses into the “Recipients” field!

This must be a bug of Katalon Studio. Or, Katalon docs and GUI should be changed and explicity say only 1 address will be accepted.

->
@duyluong

2 Likes

Why not you use a single Group account as the sole “Recipient”?

May be a Group account is easier to manage than specifying multiple addresses in Katalon’s Project Setting> Email.

@Russ_Thomas

Could you move this to the “Bug” category?

1 Like

Thanks for the suggestions. Meanwhile, will continue to see which method best fits into our maintainability and monitoring.

Hope we get to know if this is indeed a bug, intended, or there is another way to configure. And if it is covered in future releases.

Thank you for escalating, appreciate it!

1 Like

Hi Zy,

Please help me to understand the use case, so using a pre-set profile with a define list of email recipient as global variables? And you want to use this in the email recipient later on right?
And doing this making the list reusable and hence easy to maintain, am I right?

Hi Chrisstu,

Yes that is correct, to define the list of email recipients as a global variable in the execution profile. It would be more flexible and maintainable.

For example, UAT-Profile contains email1, email2, with email subject of [UAT]; Prod-Profile contains email1, email2, email 3, with email subject of [Prod]. And the test suite collection can be executed with the respective profiles.

The rationale is to define the execution profile to be used in the test suite collection level instead of creating multiple duplicate test suites with different “Mail Recipients” list. Only the execution profiles need to be maintained instead of creating multiple test suites to cater for different list of recipients.

Hope it clarifies.
Thanks!

1 Like

Hi Zy,

Thank you for clarification, we will get back if there are any updates on this.

Happy testing,
Chris

Hi @kazurayam @Katalon_team @Russ_Thomas @chrisstu are there any updates on this bug. from version 8.3.0 katalon is supporting Global variable configuration in email body - Email Settings | Katalon Docs . but i saw the same issue. for multiple Emails its not working

@chrisstu @vu.tran @nam.nguyen

Guys. This is a bug not a feature request. I moved this to bugs a good while ago. Please fix it or explain why it will not be fixed.

The application says “Recipients” not “Recipient”.

image

Thanks @Russ_Thomas for highlighting it . hope they fix this asap

I looked at the XML for the individual Test Suites where I set very specific sets of people to receive specific Test Suites. In the XML, Katalon formats these such as:

person@domain.com;nextperson@domain.com;thirdperson@domain.com;”

Notice how the last email handle has a trailing semi-colon? Kind of odd but you might try that since that’s how they format them on individual Test Suites.