1

I have text displayed in my application that "showing 1 - 20 of 25 records"

Here 20 and 25 are value of variables 'x' and 'y'. I need to extract these values of variable from message displayed on web application using Selenium IDE. Need to store 20 and 25 separately.

closely related to this question

  • Just curious: which class is this for? – user246 Apr 7 '16 at 12:11
  • application shows table database record against set filter. and writes "showing 1 - 20 of 25 records". I need to store these three numbers separately in different variable or array (preferable) , so that i can use them for loop or if condition. any help is appreciable – ian Apr 7 '16 at 23:16
1

Follow this steps :

<tr>
    <td>storeText</td>
    <td>//h1[@class='abc']</td>
    <td>k</td>
</tr>
<tr>
    <td>echo</td>
    <td>${k}</td>
    <td></td>
</tr>
<tr>
    <td>storeEval</td>
    <td>storedVars['k'].substring(storedVars['k'].lastIndexOf('- ')+2,storedVars['k'].lastIndexOf(' of'))</td>
    <td>x</td>
</tr>
<tr>
    <td>echo</td>
    <td>${x}</td>
    <td></td>
</tr>
<tr>
    <td>storeEval</td>
    <td>storedVars['k'].substring(storedVars['k'].lastIndexOf('of ')+2,storedVars['k'].lastIndexOf(' records'))</td>
    <td>y</td>
</tr>
<tr>
    <td>echo</td>
    <td>${y}</td>
    <td></td>
</tr>

Here I have used //h1[@class='abc'] element for taking its text. You can modify it.

Let me know If any queries.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.