I’m storing a text in the variable ${nombre completo} → Full name
Then I’m storing the first word as first name → ${nombre_primer_nombre}
And finally I want to trim the first word and store in another variable the rest of the text as Last Name → ${nombre_apellido}
My issue is that my code in ${nombre_apellido} is just storing the second word. How can I store the second and following words?
Example:
- ${nombre_completo} = John Smith Iverson
- ${nombre_primer_nombre} = John
- ${nombre_apellido} = Smith Iverson
My code stores “Smith” instead of “Smith Iverson”
{
“Command”: “storeText”,
“Target”: “//*[@id="main"]/div/div/div[2]/ul/li[${!LOOP}]/div/div/div[2]/div/div/div/span/span/a/span/span”,
“Value”: “nombre_completo”,
“Description”: “”
},
{
“Command”: “executeScript_Sandbox”,
“Target”: “return ${nombre_completo}.split(" ")[0].trim();”,
“Value”: “nombre_primer_nombre”,
“Description”: “”
},
{
“Command”: “executeScript_Sandbox”,
“Target”: “return ${nombre_completo}.split(" ")[1].trim();”,
“Value”: “nombre_apellido”,
“Description”: “”
},