I am new to this forum and to selenium. I tried using selenium IDE to record and playback my gmail login. I used the following steps to login. 1. Directing to gmail.com from google.com 2. Enter my userName (NOTE: Since I already logged in many times using my userName to login in firefox, my userName starts displaying in dynamic list when I start typing correct first letter of my userName. I am selecting username from that dynamic list with either keyboard or mouse) 3. Then I enter my password and click on "Signin" button.

Doing this is generating the following scripts in Selenium IDE

Commands:

  1. (command)open (Target)/ServiceLogin?service=mail&passive=true&rm=false&continue=http://mail.google.com/mail/&scc=1&ltmpl=default&ltmplcache=2
  2. (command)type (Target)id=Passwd (Value)XXXXXX
  3. (command)clickAndWait (Target)id=signIn

Since the above commands didnt record my userName, when I playback, its not getting logged-in with error "Enter your email address" in browser. I understood that since I am selecting userName from dynamic list, selenium is not recording the event. If I manually enter script for entering userName as (command)type (Target)id=Email (Value)XXXXXX and playback then its able login as expected.

Can anyone suggest me how to record selecting userName from dynamic list through Selenium IDE? I am only using Selenium IDE and No RC and web driver

share|improve this question
Whats this 'dynamic list'? Where does it come from? Can you show us a screenshot of it? Is it a list you have created? Is it the autofill of the browser that you mean? If so, no, there is no way to do that. – Arran Nov 26 '12 at 12:21

1 Answer

username textbox is not record in selenium ide you have to use Xpath of the text box.

use this code in your selenium ide, then check

<tr>
<td>open</td>
<td>https://accounts.google.com/ServiceLogin?service=mail&amp;passive=true&amp;rm=false&amp;continue=http://mail.google.com/mail/&amp;scc=1&amp;ltmpl=default&amp;ltmplcache=2</td>
<td></td>
</tr>

<tr>
<td>verifyTextPresent</td>
<td>Username</td>
<td></td>
</tr>

<tr>
<td>type</td>
<td>//*[@id=&quot;Email&quot;]</td>
<td>[email protected]</td>
 </tr>

 <tr>
<td>verifyTextPresent</td>
<td>Password</td>
<td></td>
</tr>

<tr>
<td>type</td>
<td>id=Passwd</td>
<td>password</td>
 </tr>

<tr>
<td>clickAndWait</td>
<td>id=signIn</td>
<td></td>
</tr>

<tr>
<td>verifyValue</td>
<td>id=signIn</td>
<td>Sign in</td>

enter image description here

share|improve this answer
Thanks for the quick reply. From your answer the issue of not reading userName text box is fixed. Can you please explain me how to record from the dynamic list which pops up if I have already logged in with a username. I hope since the dynamic list which popsup is browser dependent, I am not able to find xpath or HTML. Correct me if I am wrong. – user1798860 Nov 26 '12 at 21:24
And also since I know the ID for the userName field which is "Email" I can user id=Email instead of xpath right. Any special reason for using xpath? – user1798860 Nov 27 '12 at 1:17
@user1798860 - In selenium IDE we can not used id=Email because it give an error, it can not find the actual location of element in the page that why we used Xpath, CSS or Dom all this find the element in the page. – Ankit jain Nov 27 '12 at 5:37
@user1798860 - if this answer help you, then please accept my answer – Ankit jain Mar 21 at 6:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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