Set text to be modified every day

Hello,
Can I set a text which I can update every like example test@yahoo.com and then test1@yahoo.com. So every time when katalon uses this the text should be different. I am thinking will be possible with a keyword but I am not sure how to be.

Thank you in advance!

@costea.georgian89 Yes, you probably can but you will need some programming ability (or find other questions on this forum that help you build up the parts to what you need).

You will likely have to store your last used logon reference, such as test1, in a storage (spreadsheet). Then check the last character (convert the string to a digit), then add one, concatenate that new digit reference onto the “test” phrase, save the new reference to the storage (spreadsheet) and return that new reference to your testcase.

http://grails.asia/groovy-substring

I put an example with +1 digit I want like every time to be other name before @.

@costea.georgian89 you can generate an UUID or a timestamp and apend it to the generated username.
Search on the forum an you will find some real use-cases

2 Likes

yep, that’s the best solution. I have UUIDs appended to record IDs all over my tests.

Here’s the JavaScript I use. If someone want’s to Groovy-ize it and make a Keyword, be my guest…

function getUUID() {
  var d = new Date().getTime();
  if(window.performance && typeof window.performance.now === "function"){
    d += performance.now(); //use high-precision timer if available
  }
  var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
    var r = (d + Math.random()*16)%16 | 0;
    d = Math.floor(d/16);
    return (c=='x' ? r : (r&0x3|0x8)).toString(16);
  });
  return uuid;
}
1 Like

Ok thank you! I will check

Ok thank you for your example I will take a loock, a I am newbie in coding but I will try something. Thank you!