I think you need to do something like the below.
# Click tst to make the menu appear
a.span(:text => 'tst').click
# This will intelligently wait for the new menu item to be available and
then click on it.
a.span(:text => "Activar").when_present.click
On Wednesday, February 26, 2014 9:30:51 PM UTC-5, Yutzin Wong wrote:
>
> Hi,I started using watir few days ago, and still can find the way to reach
> a dojo object.
> I am using the following code, in order to display a Menu with the right
> click (In Selenium context menu).
>
>
> # encoding: utf-8
>> require 'watir-webdriver'
>> b = Watir::Browser.new
>>
>>
>> b.goto 'localhost:8080/swbadmin'
>> b.text_field(:name => 'wb_username').set 'admin'
>> b.text_field(:name => 'wb_password').set 'webbuilder'
>> b.button(:text => 'Login').click
>>
>> a = b.div(:class => 'dijitTreeNodeContainer').div(:class =>
>> 'dijitTreeIsRoot').div(:class => 'dijitTreeRow').span(:class =>
>> 'dijitTreeContent')
>> c= a.span(:text => 'tst')
>> c.right_click
>>
>
> The thing is that dijitTreeNodeContainer is made by a dojo. So i have to
> wait until it loads all the information, I tried to use Watir::wait.until{
> span(:text => 'tst').visible ?} but it dindn't work.
> With this code without the line
>
>> c= a.span(:text => 'tst')
>>
> and with c.click, I'm able to click the default TreeContent, but when I
> try with right click or double_click, it throws an exception ( ..cannot
> preform native interactions...)
> I attach the html code of the dojo objects when the page is fully loaded
> and the image of what I'm expecting to do.
>
> Thanks!
>
--
--
Before posting, please read http://watir.com/support. In short: search before
you ask, be nice.
[email protected]
http://groups.google.com/group/watir-general
[email protected]
---
You received this message because you are subscribed to the Google Groups
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.