-
1. Re: Selenium webdriver - howto click a rich:tab
jhuska Oct 14, 2013 2:15 AM (in response to gerry.matte)Hello Gerry,
I would like to recommend you to use Arquillian Graphene (much more powerful Webdriver API) project to test your RichFaces application.
Couple of reasons why to use that project, if you do not know already:
- you can leverage Page Fragments which we have prepared for you, by using them you do not have to worry which locator to use to work with tab panel, you will be able to just inject RichFacesTabPanel and use its API
- more powerful waiting API, request guards, Page Object support etc.
Using such a page fragment in a test, would look like:
@FindBy(id = "myTabPanel") private RichFacesTabPanel tabPanel; public void showcase_tab_panel() { // switching according to the tab header text RichFacesTab tab3 = tabPanel.switchTo("Tab Header 3"); // switching according to the tab header index RichFacesTab tab3 = tabPanel.switchTo(2); }
RichFaces Page Fragments are currently in this repository:
https://github.com/richfaces/richfaces-qa/tree/master/page-fragments
However, we are moving them to the RichFaces framework itself in the subsequent releases. Stay tuned when this effort is done. Meanwhile please use that dependency in order to introduce with them.
In this guide you can introduce yourself with Graphene:
http://arquillian.org/guides/functional_testing_using_graphene/
Here you can find up to date Graphene's reference documentation:
Home - Graphene 2 - Project Documentation Editor
If you wanna wait for integrating the page fragments with the RichFaces repository, you can inspire with RichFacesTabPanel page fragment implementation
There you can see that we are using .rf-tab-hdr:visible to locate the tab panel "switchers".
Feel free to ask more