Closed lukeis closed 8 years ago
Please provide a complete executable scenario and a sample page to reproduce the issue.
Reported by barancev
on 2014-01-24 13:52:12
NeedsClarification
Let's check the quick window results first. Can we?
As you can see in Pict 2, attribute Text of Option 2 looks empty. alhtough it shouldn't
be. Tried also other SelectElement options .SelectByValue and .SelectByIndex with the
same result.
Reported by prindes1@yahoo.co.uk
on 2014-01-24 16:57:26
You see an attribute Displayed == false. Invisible elements have empty text and you
can't interact with invisible elements. Full stop.
Reported by barancev
on 2014-01-24 21:00:02
Invalid
Well, I don't intend to argue, but it's OK that the drop-down Displayed attribute is
false since I'm calling xpath via its <select> name when putting the drop-down content
to SelectElemnt class. And that's, as far as I know, how SelectElement for drop-downs
is supposed to be used ...
... and I want to point out that this set-up worked perfectly fine with Selenium 2.33,
the test ran on previously ...
Reported by prindes1@yahoo.co.uk
on 2014-01-27 09:17:24
You can't work with invisible elements. First you have to perform an action that makes
the dropdown visible (click a placeholder?) and as soon as it is visible you can deal
with it.
Reported by barancev
on 2014-01-27 09:32:16
Tried to click anything to "make the dropdown visible" - obiviously didn't work.
I've recently played with various combinations of Webdriver and Firefox versions -
my outcome is the last well working combination was Webdriver 2.35 with Firefox 25.
With that being said then:
- Webdriver 2.35 wouldn't even start the FF 26
- Anything newer than Webdriver 2.35 fails to work correctly with SelectElement class
when tested on FF 25
Reported by prindes1@yahoo.co.uk
on 2014-01-27 16:16:27
All your cries are useless unless you provide a complete executable scenario and a sample
page to reproduce the issue.
Reported by barancev
on 2014-01-27 18:18:53
Okay, what's probably happening here is that your site is using some sort of JavaScript
UI widget framework (jQueryUI maybe?), which simulates a drop-down by use of <span>
and <a> elements, but stores the actual data inside a <select> element. The <select>
element holding the actual data is not visible, probably hidden by the 'ui-selectmenu-element'
CSS class.
WebDriver cannot interact with (click, send keys to, etc.) hidden elements, full stop.
The fact that you *could* manipulate the invisible <select> element in previous versions
of WebDriver was a bug, which has now been fixed.
You have three options now. First, you can use the UI elements actually visible in
the UI to select the appropriate values. Second, you could use JavaScript, along with
the API of whatever JavaScript UI toolkit you're using, to programmatically manipulate
the "dropdown" control. For either of these two options, you won't be able to use the
SelectElement class to manipulate the control, because the elements you're manipulating
won't be <select> elements. Finally, you could somehow cause the actual <select> element
to become visible, but you'll need to figure out the inner workings of your UI widget
framework to manipulate the <select> element to become visible.
Reported by james.h.evans.jr
on 2014-01-27 19:45:42
Thank you James. I've just checked your assumptions with the guys that actually created
the code I test. Yes, you've been perfectly right.
I appreciate the guides you've provided. Please, consider this issue solved.
Have a nice day
Reported by prindes1@yahoo.co.uk
on 2014-01-28 10:11:08
Reported by luke.semerau
on 2015-09-17 18:22:01
Originally reported on Google Code with ID 6897
Reported by
prindes1@yahoo.co.uk
on 2014-01-24 13:46:22