1

I am using cucumber with ruby and capybara API for some of my automation tests.There is a scenario,where I need to simulate typing into one of my textboxes to validate values on live change.I have used 'set(value)' before.'fill_in' wasnt working for me since capybara was unable to find the id/name of my textbox. Rather than setting the value, is there any method that simulates typing and then set the value to textbox since the requirement here is to validate on live change.

Thanks in advance.

user3701803
  • 93
  • 1
  • 10
  • 1
    Have you set the scenario to execute JavaScript? E.g `js: true` – Pete Sep 18 '14 at 13:07
  • I take it the "live change" is a DOM/javascript behavior? If so what @Pete mentions should be the place to start. – Anthony Sep 18 '14 at 13:49
  • You might be looking for send_keys: http://stackoverflow.com/a/23378110/634576 – Dave Schweisguth Sep 18 '14 at 16:37
  • It will help you to get an answer to post some code samples here, it is a bit vague if you are asking how to target the element or how to type into it. – ljs.dev Sep 21 '14 at 21:14

1 Answers1

5

It worked with native.send_keys("mytext"). Example:

@layout[1].find("div:nth-child(2)").find("input[role='textbox']").native.send_keys(arg1)

Thanks for the inputs

user3701803
  • 93
  • 1
  • 10