Skip to content Skip to sidebar Skip to footer

Extract Part Of A Text With Selenium Ide And Put It Into Variable

Could somebody tell me which command should I use to extract only the number(694575) from the text using Selenium Ide and to put it into a variable for further usage. Here is the d

Solution 1:

I have solution, tricky 1

store  | Edit Exhibition Centre - 694575, Exhibition Center1 | string
store  | 1 | delimiter   
store  | javascript{storedVars['string'].split('- ')[storedVars['delimiter']]} | test
store  | 0 | delimiter1
store  | javascript{storedVars['test'].split(',')[storedVars['delimiter1']]} | output
echo   | ${output}

Try this 1, and let me know whether its working for you

Solution 2:

I Have an easy answer to this question. Try this code it will work.

<tr><td>store</td><td>Edit Exhibition Centre - 694575, Exhibition Center1</td><td>string</td></tr><tr><td>store</td><td>javascript{storedVars['string'].substring(24)}</td><td>string</td></tr><tr><td>echo</td><td>${string}</td><td></td></tr><tr><td>store</td><td>javascript{storedVars['string'].substring(0,7)}</td><td>string</td></tr><tr><td>echo</td><td>${string}</td><td></td></tr>

Post a Comment for "Extract Part Of A Text With Selenium Ide And Put It Into Variable"