unselect element in a listbox

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

unselect element in a listbox

GW-5
Is it possible to unselect an item in a listbox?

I have an item that is selected by default when a page loads, what id like my test to do is deselect it and select a different item.

thanks in advance,
matt
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=1009&messageID=2825#2825

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: unselect element in a listbox

John Andersen-2
Matt,

We are having the same problems with Selenium.  I think Dan Miller
wrote a patch for the selenium team regarding this same feature and
submitted it as a possible fix - however, I have never seen anyone
commit the patch.  I'll have to check with him to see if that ever when
through or not.

-John

>>> On Wed, Jan 11, 2006 at  5:24 pm, in message
<[hidden email]>,
[hidden email] wrote:
> Is it possible to unselect an item in a listbox?
>
> I have an item that is selected by default when a page loads, what id
like
> my test to do is deselect it and select a different item.
>
> thanks in advance,
> matt
>
---------------------------------------------------------------------
> Posted via Jive Forums
>
http://forums.openqa.org/thread.jspa?threadID=1009&messageID=2825#2825
>
>
---------------------------------------------------------------------
> To unsubscribe, e- mail: selenium- users- [hidden email]
> For additional commands, e- mail: selenium- users- [hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: unselect element in a listbox

John Andersen-2
Matt,

Dan Miller looked at the latest Selenium commits and it still hasn't
been implemented.  Here is a url where he submitted the patch:

http://forums.openqa.org/thread.jspa?messageID=1147#1147

If worse comes to worse, you can download and apply the patch yourself
from that link.

Let me know how it goes!

John

>>> On Thu, Jan 12, 2006 at  8:20 am, in message
<[hidden email]>,
[hidden email] wrote:
> Matt,
>
> We are having the same problems with Selenium.  I think Dan Miller
> wrote a patch for the selenium team regarding this same feature and
> submitted it as a possible fix -  however, I have never seen anyone
> commit the patch.  I'll have to check with him to see if that ever
when
> through or not.
>
> - John
>
>>>> On Wed, Jan 11, 2006 at  5:24 pm, in message
> <73732694.1137025511980.JavaMail.oqa-
[hidden email]>,
> forum- selenium- [hidden email] wrote:
>> Is it possible to unselect an item in a listbox?
>>
>> I have an item that is selected by default when a page loads, what
id
> like
>> my test to do is deselect it and select a different item.
>>
>> thanks in advance,
>> matt
>>
>
---------------------------------------------------------------------
>> Posted via Jive Forums
>>
>
http://forums.openqa.org/thread.jspa?threadID=1009&messageID=2825#2825
>>
>>
>
---------------------------------------------------------------------
>> To unsubscribe, e-  mail: selenium-  users-  [hidden email]
>> For additional commands, e-  mail: selenium-  users-
[hidden email]
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e- mail: selenium- users- [hidden email]
> For additional commands, e- mail: selenium- users- [hidden email]


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: unselect element in a listbox

GW-5
In reply to this post by GW-5
thanks got that patch to work.

this may also work:

Selenium.prototype.doClearSelection = function(locator) {
        var list = this.page().findElement(locator);
        list.selectedIndex = -1;
};

-Matt
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=1009&messageID=2833#2833

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]