|
View:
New views
10 Messages
—
Rating Filter:
Alert me
|
|
|
using Simulator to select ComboBox itemPlease 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 qooxdoo-devel@... https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel |
|
|
Re: using Simulator to select ComboBox itemChi 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 > qooxdoo-devel@... > 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 qooxdoo-devel@... https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel |
|
|
|
|
|
|
|
|
Re: using Simulator to select ComboBox itemThomas,
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" <chimo@...> > *To:* "qooxdoo Development" <qooxdoo-devel@...> > *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 qooxdoo-devel@... https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel |
|
|
Re: using Simulator to select ComboBox item> 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 qooxdoo-devel@... https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel |
|
|
Re: using Simulator to select ComboBox itemI'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 > qooxdoo-devel@... > 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 qooxdoo-devel@... https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel |
|
|
Re: using Simulator to select ComboBox item> 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 qooxdoo-devel@... https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel |
|
|
Re: using Simulator to select ComboBox item> 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 qooxdoo-devel@... https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel |
|
|
Re: using Simulator to select ComboBox item> > 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 qooxdoo-devel@... https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel |
| Free Forum Powered by Nabble | Forum Help |