3

I am new to selenium. I have an issue in spliting the string.

<tr>
    <td>storeEval</td>
    <td>dList = '${StaffAdminEmail}'.split('@'); </td>
    <td>dsplit1 </td>
</tr>
<tr>
    <td>storeEval</td>
    <td>day = storedVars.dsplit1[1]</td>
    <td>dsplit2</td>
</tr>
<tr>
    <td>type</td>
    <td>id=school_permalink</td>
    <td>${dsplit2}</td>
</tr>

where ${StaffAdminEmail} = [email protected]

I got an error like this

[error] Threw an exception: storedVars.dsplit1 is undefined

After google search i got a link but i dont know how to use it with my example.Any ideas??

3
  • you not echo ${dsplit1}
    – Sridhar R
    Commented Nov 5, 2013 at 8:52
  • I tried <td>echo$(dsplit1)</td>,but it shows as echo$(dsplit1).
    – Jerin Jose
    Commented Nov 5, 2013 at 9:00
  • problem is dsplit1 is undefined so define in your table then split
    – Sridhar R
    Commented Nov 5, 2013 at 9:01

1 Answer 1

0

I believe you simply need to remove the whitespace after dsplit1 in the first command

from

<tr>
    <td>storeEval</td>
    <td>dList = '${StaffAdminEmail}'.split('@'); </td>
    <td>dsplit1 </td>
</tr>

to

<tr>
    <td>storeEval</td>
    <td>dList = '${StaffAdminEmail}'.split('@'); </td>
    <td>dsplit1</td>
</tr>
1
  • I tried it and removing the whitespace got me past the error message you described. Didn't you get past that error message?
    – AnnTea
    Commented Nov 5, 2013 at 9:51

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.