Selecting UI-elements in Vaadin-application

652 views
Skip to first unread message

Jukka Karvonen

unread,
Jan 9, 2012, 1:45:24 AM1/9/12
to robotframework-users

Hi,

I'm a newbie with Vaadin, and I would like to ask you how Robot
framework can select UI-elements in web-application which is
implemented with Vaadin?

For example this Vaadin demo application, how can I select the
buttons?

http://demo.vaadin.com/Calc

Br, Jukka

Mikko Korpela

unread,
Jan 9, 2012, 2:13:35 AM1/9/12
to jjka...@gmail.com, robotframework-users
Hi,

Robot Framework is not a tool that interacts with the system under
test directly. It uses libraries that can interact with different
kinds of systems.

In your case you could use SeleniumLibrary (or Selenium2Library or
some other custom library).

I suggest that you first check out the demo in the SeleniumLibrary
page ( http://code.google.com/p/robotframework-seleniumlibrary/ ).

Kind Regards,
Mikko Korpela

2012/1/9 Jukka Karvonen <jjka...@gmail.com>:

> --
> You received this message because you are subscribed to the Google Groups "robotframework-users" group.
> To post to this group, send email to robotframe...@googlegroups.com.
> To unsubscribe from this group, send email to robotframework-u...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/robotframework-users?hl=en.
>

--
Mikko Korpela

Jukka Karvonen

unread,
Jan 9, 2012, 2:31:37 AM1/9/12
to robotframework-users

Hi Mikko,

I have used Robot Framework with SeleniumLibrary for testing with
normal html-webpages. Now I'm starting to work on webpages which
contain Vaadin UI-elements.

I'm having problems to select Vaadin UI-elements with SeleniumLibrary,
so that is the problem I'm seeking advice.

Br, Jukka


On 9 tammi, 09:13, Mikko Korpela <mikko.korp...@gmail.com> wrote:
> Hi,
>
> Robot Framework is not a tool that interacts with the system under
> test directly. It uses libraries that can interact with different
> kinds of systems.
>
> In your case you could use SeleniumLibrary (or Selenium2Library or
> some other custom library).
>
> I suggest that you first check out the demo in the SeleniumLibrary
> page (  http://code.google.com/p/robotframework-seleniumlibrary/ ).
>
> Kind Regards,
> Mikko Korpela
>
> 2012/1/9 Jukka Karvonen <jjkar...@gmail.com>:

Mariya Nikolova

unread,
Jan 9, 2012, 3:05:27 AM1/9/12
to jjka...@gmail.com, robotframework-users
Hi Jukka,

you can use SeleniumLibrary or SeleniumLibrary to locate your button with jQuery Selectors. As far as I could see you don't have jQuery on your page.
So you have two possibilities you could add some attributes to your buttons (like  name, title and so on) and locate them with css selectors. This will look like this in Selenium 2

Click Element css=.v-button-caption[title="8"]

 if we take that your button 8 has title attributes 8.
If you don't have the possibilities to add new attributes or you don't want it, the other possibilities is to use jQuery selectors. By using them you don't need to change your application.
You will need to load jQuery (this will be the best by importing it directly on your application). If you have it on your application you can just use it from your robot tests.

Once you have jQuery on your application you can locate your buttons like this:

Execute Javascript jQuery(".v-button-caption:contains(8)").click();

for example to click button 8.

Hope this helps.

BR
Mariya

2012/1/9 Jukka Karvonen <jjka...@gmail.com>

Jukka Karvonen

unread,
Jan 20, 2012, 5:36:59 AM1/20/12
to robotframework-users

Hi Mariya,

Thanks for your advice!

I tried to use the jQuery, but somehow it did not work with the
application. Then I started to use the xpath-locator, but the problem
I had with it, was that I wasn't able to find the appropriate element-
path.

The solution was however, I user the Selenium IDE to find out the
element-paths and I then put them to the Robot-script, and then it
worked!

Br, Jukka


On 9 tammi, 10:05, Mariya Nikolova <hali...@googlemail.com> wrote:
> Hi Jukka,
>
> you can use SeleniumLibrary or SeleniumLibrary to locate your button with
> jQuery Selectors. As far as I could see you don't have jQuery on your page.
> So you have two possibilities you could add some attributes to your buttons
> (like  name, title and so on) and locate them with css selectors. This will
> look like this in Selenium 2
>
> Click Element css=.v-button-caption[title="8"]
>
>  if we take that your button 8 has title attributes 8.
> If you don't have the possibilities to add new attributes or you don't want
> it, the other possibilities is to use jQuery selectors. By using them you
> don't need to change your application.
> You will need to load jQuery (this will be the best by importing it
> directly on your application). If you have it on your application you can
> just use it from your robot tests.
>
> Once you have jQuery on your application you can locate your buttons like
> this:
>
> Execute Javascript jQuery(".v-button-caption:contains(8)").click();
>
> for example to click button 8.
>
> Hope this helps.
>
> BR
> Mariya
>
> 2012/1/9 Jukka Karvonen <jjkar...@gmail.com>
Reply all
Reply to author
Forward
0 new messages