'Selenium IDE : How to press 'Enter' once text is entered in the search field using
I am using Selenium IDE 2.9.1 + FireFox 52.0.1. I have a data table with search fields.
Once I enter text in the search field which command should I use to simulate a user pressing Enter
(submit to search this text in the data table).
Solution 1:[1]
Here is how I accomplish this with Selenium IDE
Command: sendKeys
Target:
Value: UTF for Enter - U+E007
Solution 2:[2]
You can use keypress
command to stimulate the button events.
Below is an example of searching test
string in google.
You should specify the field's selector in the keypress event.
Here \13
is the ASCII value of Enter
Key.
<tr>
<td>type</td>
<td>id=lst-ib</td>
<td>test</td>
</tr>
<tr>
<td>keyPress</td>
<td>id=lst-ib</td>
<td>\13</td>
</tr>
Solution 3:[3]
I'll mirror what's been said above, but, the best bet here is to use SENDKEYS
and get the actual ID
of the element from the DOM to pass in as the identifier (:value)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Jasmine James |
Solution 2 | kripindas |
Solution 3 | Jim VanNest |