Re: [wtr-general] Removing reference to an element

2012-01-31 Thread Jari Bakken
On Tue, Jan 31, 2012 at 4:55 PM, Rahul Sharma wrote:

>
> browser.select_list(:how, :what).enabled? I still get false as it
> still holds the reference to the old element and since the page hasn't
> refreshed it doesn't know its been now enabled by the javascript.
>

Element references in watir-webdriver are live - if the underlying element
changes, so will the return value of #disabled?
In any case, calling browserselect_list twice will always relocate the
element, so you're not holding on to any reference at all.

Without seeing the code (HTML/CSS/JS/Ruby) in question, it's hard to tell
why you're running into trouble, but some possible cases:

1. The .select_list call is not finding the element you think it is.
2. The disabled state is changing asynchronously, and you have a race
condition.

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com


[wtr-general] Removing reference to an element

2012-01-31 Thread Rahul Sharma
Hi Guys,

I am using watir-webdriver and as I understand, it stores the
reference to an element once it's been defined. So I have this
select_list that is disabled.
In irb when I do

browser.select_list(:how, :what).disabled? => true

Then I select some option on the page which fires a Javascript and
enables the select_list but when I do

browser.select_list(:how, :what).enabled? I still get false as it
still holds the reference to the old element and since the page hasn't
refreshed it doesn't know its been now enabled by the javascript. Is
there a way to delete the old reference

Thanks,

Rahul

-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

watir-general@googlegroups.com
http://groups.google.com/group/watir-general
watir-general+unsubscr...@googlegroups.com