We are looking to use global variable in execution profiles to include different list of email recipients. E.g. using ${GlobalVariable.EmailRecipients}
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.
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.
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?
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.
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:
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.