5

I am in need to fill_in a textarea which does not have an id. Following the inspection:

<textarea class="stock-description-input js-short-description-textarea" placeholder="Select a product or enter a description" maxlength="64"></textarea>

Have you got an idea how to do it?

alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
TakeMeToTheMoon
  • 527
  • 1
  • 8
  • 25

1 Answers1

7

There are different location techniques and ways to get to the desired element. stock-description-input class looks like a good thing to rely on. Use send_keys() to fill the area:

text_area = first(:css, 'textarea.stock-description-input').native
text_area.send_keys('Test')
Community
  • 1
  • 1
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195