0

Using the Ruby Page Object Gem, I am trying to send a string to a text input field with the following html:

<input id="marketerAssignmentForm:marketerName" name="marketerAssignmentForm:marketerName" type="text" value="" maxlength="65" tabindex="3">

I set the element like so:

text_field(:name_form, :xpath => "//*[@id='marketerAssignmentForm:marketerName']")

and then call this method in my code, trying to send in the text to the input field:

name_form= 'my string'

This page object code does not fill in the input field, am i using the wrong syntax or is this field not actually a text_field?

The following basic selenium code works as I would expect the page object method to work:

$driver.find_element(:xpath, "//*[@id='marketerAssignmentForm:marketerName']").send_keys('my string')

Any help would be appreciated!

Austin L
  • 336
  • 1
  • 17
  • `name_form= 'my string'` just sets a local variable. You need a receiver - either `self` if calling from within a method of the page object or the page object instance. – Justin Ko Jun 14 '16 at 20:45
  • self.name_form= 'my string' in my case works as expected. Thank you @Justin Ko – Austin L Jun 14 '16 at 20:56

0 Answers0