0

I am trying to extract a text string from a variable and add that into a new command on Selenium IDE. The test suite looks like this -

storeAttribute | link=EMQ Welcome Page@href | window
echo | ${window} 

echo window gives this long piece of text abcd1ef1526o.ti.jdnv:8350/psp/TULINDI/FINANCE/ENTP/s/WEBLIB_SSO_Z.ISCRIPT1.FieldFormula.IScript_Open_Third_Party?AppType=EMQ&FTPUrl=https%3a//ghij2kl1525m.ti.jdnv/EmqWorkbenchWeb/includes/emqWelcomePage.faces&PORTALPARAM_PTCNAV=Z_EMQ_WELCOME&EOPP.SCNode=ENTP&EOPP.SCPortal=FINANCE&EOPP.SCName=Z_EMQ&EOPP.SCLabel=EMQ&EOPP.SCPTfname=Z_EMQ&FolderPath=PORTAL_ROOT_OBJECT.Z_EMQ.Z_EMQ_WELCOME&IsFolder=false

What i would like to do is extract the part ghij2kl1525m.ti.jdnv (which is a server name) and store that as a new variable. So i have tried like this, but it cant seem to get it to work...

store | ${window} | string
store | 1 | delimiter
store | javascript{storedVars['string'].split('a// ')[storedVars['delimiter']]} | test
store | 0 | delimiter1
store | javascript{storedVars['test'].split('ti.jdnv/Emq ')[storedVars['delimiter1']]} | output
echo ${output} 

This is my echo of output

[info] Executing: |echo | ${output} | |

[info] echo: javascript{storedVars['test'].split('.ti.jdnv/Emq ')[storedVars['delimiter1']]}

Obvioulsy, what im expecting is for $output to be ghij2kl1525m.ti.jdnv. Is it possible to feed in a variable to that list on commands like that and where am i going wrong?

Any help greatly apprecicated.

1 Answer 1

0

change 'store' to 'storeEval' in 3rd and 5th line

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.