using Simulator to select ComboBox item

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

using Simulator to select ComboBox item

Chi Mo
Please look at http://demo.qooxdoo.org/current/showcase/#Form , there is a ComboBox for 'Type', if you click it, you can get something like: CD, Clock, etc. My question is how to use Selenium(Simulator) to select one of those items, e.g: "Clock"?

Many thanks.
Chi



-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: using Simulator to select ComboBox item

thron7
Chi Mo wrote:
> Please look at http://demo.qooxdoo.org/current/showcase/#Form , there is a ComboBox for 'Type', if you click it, you can get something like: CD, Clock, etc. My question is how to use Selenium(Simulator) to select one of those items, e.g: "Clock"?
>  

Hi Chi,

aren't you the guy working with Hugh? You seem to be on and off of the
mailing list.

I thought you were aware of the Simulator project. The
"test_showcase.js" of the sample simulations does exactly that (although
you might want to come up with a better locator).

Thomas

> Many thanks.
> Chi
>
>
>  
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
> Studies have shown that voting for your favorite open source project,
> along with a healthy diet, reduces your potential for chronic lameness
> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
> ------------------------------------------------------------------------
>
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>  


-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: using Simulator to select ComboBox item

Chi Mo
In reply to this post by Chi Mo
Hi Thomas,


>Chi Mo wrote:
>> Please look at http://demo.qooxdoo.org/current/showcase/#Form , there is a ComboBox for 'Type', if you click it, you can get something like: CD, Clock, etc. My question is how to use Selenium(Simulator) to select one of those items, e.g: "Clock"?
>>  
>
>Hi Chi,
>
>aren't you the guy working with Hugh? You seem to be on and off of the
>mailing list.

Yes I am.

>
>I thought you were aware of the Simulator project. The
>"test_showcase.js" of the sample simulations does exactly that (although
>you might want to come up with a better locator).

I got it, I'd try it. Many thanks

Chi

>Thomas
>> Many thanks.
>> Chi
>>
>>
>>  
>> ------------------------------------------------------------------------
>>
>> -------------------------------------------------------------------------
>> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
>> Studies have shown that voting for your favorite open source project,
>> along with a healthy diet, reduces your potential for chronic lameness
>> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> qooxdoo-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>  
>
>
>
>-------------------------------------------------------------------------
>Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
>Studies have shown that voting for your favorite open source project,
>along with a healthy diet, reduces your potential for chronic lameness
>and boredom. Vote Now at http://www.sourceforge.net/community/cca08
>_______________________________________________
>qooxdoo-devel mailing list
>[hidden email]
>https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
                       





-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: using Simulator to select ComboBox item

Chi Mo
In reply to this post by Chi Mo
>I thought you were aware of the Simulator project. The
>"test_showcase.js" of the sample simulations does exactly that (although

I can see the list when I use

//div[text()="My Text"]/following-sibling::div/descendant::img[contains(@src,"down.gif")]'

but, the item is not selected if I use:

  sel.qxClick('//div[text()="My Item"]');

There is not any error info in the log. It seems that everything goes well, but the item has not been selected.

Chi


>>
>>  
>> ------------------------------------------------------------------------
>>
>> -------------------------------------------------------------------------
>> Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
>> Studies have shown that voting for your favorite open source project,
>> along with a healthy diet, reduces your potential for chronic lameness
>> and boredom. Vote Now at http://www.sourceforge.net/community/cca08
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> qooxdoo-devel mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>  
>
>
>
>-------------------------------------------------------------------------
>Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
>Studies have shown that voting for your favorite open source project,
>along with a healthy diet, reduces your potential for chronic lameness
>and boredom. Vote Now at http://www.sourceforge.net/community/cca08
>_______________________________________________
>qooxdoo-devel mailing list
>[hidden email]
>https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
                       





-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: using Simulator to select ComboBox item

Hugh Gibson-2
Thomas,

I get the same result as Chi when using Selenium IDE. I can get the combo
to drop down but can't select from it.

Looking at the DOM it appears that the menu is implemented by a table - I
can see class qooxoo-table-cell for the div which contains the text in
the drop-down list.

Perhaps there is a problem with tables and Selenium - see the earlier
code in test_showcase.js:

function Table (sel)
{
  sel.qxClick('//div[text()="Table"]')

  // selections not working
  sel.qxClick('//div[text()="3"]');
 
Chi, do you know what is required to click in a table?

Hugh  

> *Subject:* Re: [qooxdoo-devel] using Simulator to select ComboBox
> item
> *From:* "Chi Mo" <[hidden email]>
> *To:* "qooxdoo Development" <[hidden email]>
> *Date:* Thu, 10 Jul 2008 23:40:49 +0800
>
> >I thought you were aware of the Simulator project. The
> >"test_showcase.js" of the sample simulations does exactly that
> (although
>
> I can see the list when I use
>
> //div[text()="My
> Text"]/following-sibling::div/descendant::img[contains(@src,"down.gi
> f")]'
>
> but, the item is not selected if I use:
>
>   sel.qxClick('//div[text()="My Item"]');
>
> There is not any error info in the log. It seems that everything
> goes well, but the item has not been selected.
>
> Chi



-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: using Simulator to select ComboBox item

Hugh Gibson-2
> Looking at the DOM it appears that the menu is implemented by a
> table - I can see class qooxoo-table-cell for the div which contains
> the text in the drop-down list.
>
> Perhaps there is a problem with tables and Selenium - see the
> earlier code in test_showcase.js:

In an earlier thread I found reference to
http://qooxdoo.org/documentation/contrib/simulator/qooxdoo-tests-with-sele
nium#clicking_in_tables

However, I'm using qxClickAt but it's still not working.

Having done some tracing I've found that the click is getting through,
but the coordinates are outside the pane clipper position. If I click the
first element in the pane, the X coordinate is 251 in my test case but
the clipper starts at 252 (this is in
qx.ui.table.pane.Scroller._getRowForPagePos). Therefore in
qx.ui.table.pane.Scroller._onmousedownPane the "col" is null and no
selection takes place.

The raw Selenium mouse click routines have the option of passing through
X,Y coordinates. When I use mouseDownAt and pass through 10,10 then the
click works OK. Therefore that is a workaround.

I note from the qooxdoo Selenium user-extension.js on line 428:

* TODO: implement it like doFooAt, where additional coordinates will be
added to the element-coords
 
Given that you have the eventParams having a large number of options, so
we can't simply pass an X,Y string, I suggest that we extend the
eventParams to have a offsetClientX and offsetClientY value.

To implement this it would probably be best to have clickElementQx take
an instance of MouseEventParameters rather than the string, so
doQxClickAt can manipulate the coordinates.

Therefore with this proposed change you could do qxClickAt with params
offsetClientX=10,offsetClientY=10 and it would work OK.

That would be the second workaround and a useful facility anyway. However,
the main bug is that the start coordinates for the row div are outside
the pane clipper.

Hugh

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: using Simulator to select ComboBox item

thron7
I'm sorry I have very little time to look into these things currently.

If you make changes to the Simulator user_extensions.js, just keep in
mind that other projects are using it too, so don't break existing code.
This also means don't just change the signature of existing methods
(e.g. clickElementQx), but rather add functionality if necessary.

Furthermore, user_extensions.js should have as little knowledge as
possible about how particular widgets are implemented in qooxdoo. This
concerns the ComboBox being built on the Table, which can change anytime
(as you know ;). I'd rather prefer a more "semantic" abstraction in the
user extensions, and work-arounds in the client code. I don't think it
is a good idea to click by coordinates when there is a chance to click
on identifiable elements anyway. It should boil down to intelligent
locators, not coordinates.

I'm still wondering why the exact same thing is working in the (rather
crude ) test_showcase.js Simulator script ...?!

Thomas

>> Looking at the DOM it appears that the menu is implemented by a
>> table - I can see class qooxoo-table-cell for the div which contains
>> the text in the drop-down list.
>>
>> Perhaps there is a problem with tables and Selenium - see the
>> earlier code in test_showcase.js:
>>    
>
> In an earlier thread I found reference to
> http://qooxdoo.org/documentation/contrib/simulator/qooxdoo-tests-with-sele
> nium#clicking_in_tables
>
> However, I'm using qxClickAt but it's still not working.
>
> Having done some tracing I've found that the click is getting through,
> but the coordinates are outside the pane clipper position. If I click the
> first element in the pane, the X coordinate is 251 in my test case but
> the clipper starts at 252 (this is in
> qx.ui.table.pane.Scroller._getRowForPagePos). Therefore in
> qx.ui.table.pane.Scroller._onmousedownPane the "col" is null and no
> selection takes place.
>
> The raw Selenium mouse click routines have the option of passing through
> X,Y coordinates. When I use mouseDownAt and pass through 10,10 then the
> click works OK. Therefore that is a workaround.
>
> I note from the qooxdoo Selenium user-extension.js on line 428:
>
> * TODO: implement it like doFooAt, where additional coordinates will be
> added to the element-coords
>  
> Given that you have the eventParams having a large number of options, so
> we can't simply pass an X,Y string, I suggest that we extend the
> eventParams to have a offsetClientX and offsetClientY value.
>
> To implement this it would probably be best to have clickElementQx take
> an instance of MouseEventParameters rather than the string, so
> doQxClickAt can manipulate the coordinates.
>
> Therefore with this proposed change you could do qxClickAt with params
> offsetClientX=10,offsetClientY=10 and it would work OK.
>
> That would be the second workaround and a useful facility anyway. However,
> the main bug is that the start coordinates for the row div are outside
> the pane clipper.
>
> Hugh
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
>  


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: using Simulator to select ComboBox item

Hugh Gibson-2
> I'd rather prefer a more "semantic" abstraction in the
> user extensions, and work-arounds in the client code.

Agreed.

> I don't think it
> is a good idea to click by coordinates when there is a chance to
> click on identifiable elements anyway. It should boil down to
> intelligent locators, not coordinates.

It's not clicking by coordinates, but adding an offset to the coordinates.
However, I agree - it should just work without them.

> I'm still wondering why the exact same thing is working in the
> (rather crude ) test_showcase.js Simulator script ...?!

Probably because we're using ComboBoxEx.

So there is still a need to fix up clicking in tables for some reason.

Similarly to you I have very little time to spend on these things. We
have a workaround at the moment, using explicit mouseDownAt and mouseUpAt.
I think that might be where it is left for the moment. I've added a note
to the Wiki.

Hugh

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: using Simulator to select ComboBox item

thron7

> Similarly to you I have very little time to spend on these things. We
> have a workaround at the moment, using explicit mouseDownAt and mouseUpAt.
> I think that might be where it is left for the moment. I've added a note
> to the Wiki.
>  

Appreciated.

Thomas


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
Reply | Threaded
Open this post in threaded view
|

Re: using Simulator to select ComboBox item

Hugh Gibson-2
In reply to this post by Hugh Gibson-2
> > Looking at the DOM it appears that the menu is implemented by a
> > table - I can see class qooxoo-table-cell for the div which
> > contains
> > the text in the drop-down list.
> >
> > Perhaps there is a problem with tables and Selenium - see the
> > earlier code in test_showcase.js:
>
> In an earlier thread I found reference to
> http://qooxdoo.org/documentation/contrib/simulator/qooxdoo-tests-wit
> h-sele
> nium#clicking_in_tables
>
> However, I'm using qxClickAt but it's still not working.
>
> Having done some tracing I've found that the click is getting
> through,
> but the coordinates are outside the pane clipper position.

It's a Selenium bug. I've reported it at
http://jira.openqa.org/browse/SEL-563

Hugh

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel