I am having trouble accessing the nested divs.
here is my scenario. I need to access the total in inner div. Can some one please shed some light here.
<div id="RequestSend">
<div class="title">
Requests Sent
</div>
<div class="total">
10
</div>
</div>
<div id="RequestReceived">
<div class="title">
Requests Received
</div>
<div class="total">
20
</div>
</div>
I tried the following, but did not succeed.
Approach 1:
prof.rb
=======
div(:total_count, {:class => 'total'})
div(:request_send, {:id => 'RequestSend'})
prof_spec.rb
=============
page.request_send_element.total_count.should eq 10
Output:
NoMethodError: undefined method `total_count' for #<Selenium::WebDriver::Element:0x....>
Approach 2:
prof.rb
=======
divs(:total_count, {:class => 'total'})
prof_spec.rb
============
total_count[0] # for first
total_count[1] # for second
Please note I am a new user to page object.