Do we have a text wrap feature?

I’m having a hard time collecting data especially with elements containing full name. I would like to store the full name in a variable then divide the first name and the last name.

Example
Text: firstName lastName

I want to chop down the firstName and lastName to separate variables.

Hope someone can enlighten me if this is possible. Thanks!

1 Like

Why not use Groovy String split()

For example:

def str='firstName lastName'
def names = str.split()       // this will be ['firstName', 'lastName']

see http://grails.asia/groovy-split

kazurayam said:

Why not use Groovy String split()

For example:

def str='firstName lastName'

def names = str.split() // this will be [‘firstName’, ‘lastName’]


see http://grails.asia/groovy-split

  

Hi,

Appreciate your response but I’m inquiring using Katalon Recorder commands. Not familiar using groovy.

Thank you for using our product. You can use JavaScript function in “storeEval” command to split the fullname string. Please check out “Working with variables” example at https://github.com/katalon-studio/katalon-recorder-samples.

Alex,

I have seen the example but there is no example to split the string although there is example to concatenate Can you please provide example to split a strong which will be working in Katalon recorder

There was a similar request for this at the below link:

Try

store | 'Katalon Recorder' | fullName
storeEval | fullName.split(' ') | names
storeEval | names[0] | firstName
storeEval | names[1] | lastName
1 Like