Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8620953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T06:42:19+00:00 2026-06-12T06:42:19+00:00

In the project on which I add tests, I have some elements complicated to

  • 0

In the project on which I add tests, I have some elements complicated to “get”.
The html of my textarea :

<div class="quote">        
 <div class="clearfix">          
  <div class="icon"></div>            
   <div class="text">
    <span class="yui3-widget yui3-inputwidget yui3-textareawidget yui3-textareawidget-focused" style="">
     <span class="yui3-textareawidget-content">
      <textarea name="" placeholder=""></textarea>
     </span>
    </span>
   </div>        
   <div class="author">
    (...) other text_field 
   </div>
  </div>        
 </div>    
</div>

For the moment, I use this line to set value

@browser.element(:css => ".quote textarea").send_keys "test"

In PageObject, I should declare the element and use it :

# declaration at the top
element(:quote_text, :css => ".quote textarea") 
# use it where I need
self.quote_text = "text"

But I get this error when I use :

undefined method `quote_text=' for #<PublishPage:0x33843c0> (NoMethodError)

Where am I wrong ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T06:42:21+00:00Added an answer on June 12, 2026 at 6:42 am

    When you do element(:quote_text, :css => ".quote textarea"), it will only generate the methods (see doc):

    quote_text #Returns the text of the element
    quote_text_element #Returns the element
    quote_text? #Returns if the element exists
    

    Since you know it is a text area and want the text area methods, you should declare it as:

    text_area(:quote_text, :css => ".quote textarea") 
    

    This will give you the quote_text= method you expect (see doc).

    Update – Since Watir-Webdriver only support css-selectors at the element class (see Issue 124), you will also need to change the locator. Two alternative declarations for quote_text that seem to work:

    #Using a block to locate the element:
    text_area(:quote_text){ div_element(:class => "quote").text_area_element }
    
    #Using xpath:
    text_area(:quote_text, :xpath => '//div[@class="quote"]//textarea') 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a project which has some lib's associated with it (in Build Path).
I have some NUnit tests which uses a TestCaseSource function. Unfortunately, the TestCaseSource function
I have an xcode workspace which is set up with some project libraries which
We need to write some automated UI Tests on a project which is done
I'm trying to add a navigational menu for my project which uses the ASP.NET
I'm working on an ASP.NET MVC project which uses the MarkdownDeep Editor to add
In TFS, I add a VS project (which adds the project into source control
I'm creating a simple CMS using kohana3 in which user can add project to
i made a windows service & add project installer.in which only contain this code.
For my Java project which uses Maven I have added Twitters Bootstrap lately to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.