Selenium on text fields that trigger events, a way to simulate human interaction

I am trying to test a webpage in selenium which is created using angularjs. This page contains text fields that the user will fill out. When the user enters text fields, angular will record every keystroke and display the preview on the fly exactly as filling out a question about the stack shows creating a preview. :)

My problem: I cannot figure out how to test it. If I click on the text box and type it, this will work. I tried a command like selenium, a typeKeys command, using the mousedown and mouseup commands, and then typeKeys to try to simulate user input. But they do not work, as if event handlers were not triggered. I need to imitate human types in order for events to fire. This is what I think, but it does not work.

<tr>
  <td>mouseDown</td>
  <td>name=appName</td>
  <td></td>
</tr>
<tr>
  <td>mouseUp</td>
  <td>name=appName</td>
  <td></td>
</tr>
<tr>
  <td>typeKeys</td>
  <td>name=appName</td>
  <td>foobar</td>
</tr>

If there is a way to use javascript, that would also be acceptable. Thank you

+5
source share
2 answers

Angular JS Selenium IDE. , , clickAt, keypress .. , , sendKeys, . , Selenium-IDE

sendKeys | xpath=(//input[@type='text'])[2] | TEXT To Enter

, xpath, , (css =, xpath,//div), , sendKeys .

+5

.

+1

All Articles