Friday 17 February 2012

Selenium IDE split text - Get require string from sentence

Split text from sentence

Suppose you have sentence as 'my name is : radical' and you want only radical text from whole sentence, use below code

store   | my name is : radical | string
  store | 1 | delimiter
  store | javascript{storedVars['string'].split('is :')[storedVars['delimiter']]} | name
 echo  | ${name}

4 comments:

  1. What if I want to use text BEFORE specified string?

    ReplyDelete
  2. I small change will work for you-

    store | 0 | delimiter

    ReplyDelete
  3. what if I want text as radica

    ReplyDelete