robot remotewebdriver testing with SeleniumGird from Jenkins Slave (docker container)

603 views
Skip to first unread message

Jeroen Wolff

unread,
Dec 18, 2017, 9:13:42 AM12/18/17
to robotframework-users

Hi all,


I'm trying to make a Jenkins slave container with the needed python bin/libs/pips to get my robot test working with a running Selenium Grid in my container cluster.

The Selenium Grid is working fine with several chrome and firefox nodes. A (Java) test with the remotewebdriver is working find.


Now i would like te make a robot (UI) test to make use of my Selenium Grid.


In my docker images i fave the following bin/lib/pip


COPY rpm/. /tmp/rpm/

COPY pip/. /tmp/pip/


# install Python and needed tools

RUN yum -y --nogpgcheck localinstall \

    /tmp/rpm/python-devel-2.7.5-58.el7.x86_64.rpm \

    /tmp/rpm/python2-pip-8.1.2-5.el7.noarch.rpm \

    /tmp/rpm/python-setuptools-0.9.8-7.el7.noarch.rpm \

    && rm -rf /tmp/rpm


# install robotframework

RUN pip install --no-cache --index-url=http://internalrepo/pypi/web/simple --trusted-host=internalrepo \

    robotframework \

    robotframework-difflibrary \

    robotframework-extendedselenium2library


And this is the test i'm running (note i am not a robot specialist ;)


*** Settings ***

Documentation     Robot Framework Example

Library           Collections

Library           Selenium2Library


*** Variables ***

${GRID_URL}     http://selenium-hub.example.com:80/wd/hub

${BROWSER}        chrome

${ALIAS}          None



*** Test Cases ***

javaee7-angular

    Open Browser  http://app.example.com  ${BROWSER}  None ${GRID_URL}

    Maximize Browser Window

    Input Text    name  Naam

    Input Text    description    Beschrijving

    Click Button    xpath=//button[@class='btn btn-primary' and @type='button']

    Click Link    xpath=//a[text()='2']

    Click Element    xpath=//span[text()='Kurama']

    ${imageURL}=    Selenium2Library.Get Element Attribute    //div[@ng-if='person.imageUrl']/img[1]@src

    Should Be Equal As Strings    http://img1.wikia.nocookie.net/__cb20140818171718/naruto/images/thumb/7/7b/Kurama2.png/300px-Kurama2.png    ${imageURL}

    Collections.Set To Dictionary    ${Dummy}    key1=value1    key2=value2

    Close Browser


The fault is: 


could not be run on failure: No browser is open

| FAIL |

WebDriverException: Message: 'chromedriver' executable needs to be in PATH. Please see 



I was thinking that i don't need that driver 'locally' because i'm using a grid and a remote webdriver...


Can somebody help me thinking in the right direction?


Regards,


Jeroen

Tatu Aalto

unread,
Dec 18, 2017, 9:21:22 AM12/18/17
to jeroen...@gmail.com, robotframework-users
Ugh

I think, you should also provide desired_capabilities argument for the Open Browser keyword[1]. If I recall correctly the code, if desired_capabilities or remote_url is not given, keyword will try to open browser locally. 



--
You received this message because you are subscribed to the Google Groups "robotframework-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-users+unsub...@googlegroups.com.
To post to this group, send email to robotframework-users@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

Jeroen Wolff

unread,
Dec 19, 2017, 5:30:21 AM12/19/17
to robotframe...@googlegroups.com
Thanks Tatu!

When I try this 

Open Browser  http://demoapp.example.com  browser=chrome desired_capabilities=browserName:chrome remote_url=http://selenium-hub.example.com:80/wd/hub

But i'm not sure if i'm using the right syntax ;)

ValueError: chrome desired_capabilities=browserName:chrome remote_url=http://selenium-hub.example.com:80/wd/hub is not a supported browser.


Thanks!

Tatu Aalto

unread,
Dec 19, 2017, 5:57:41 AM12/19/17
to jeroen...@gmail.com, robotframework-users
Ugh

Error looks like a syntax problem in the test data and it seems that cell separator[1] between the arguments is not correctly defined. There are multiple formats to write test data, but it looks like you are using plain text format and the cell separator are spaces. If the above is true, then it looks like you are only using one space as a separator and that is not enough. There should be at least two spaces, the recommendation is four spaces (for clarity and align with Python), between cells in the test data.

Next time, please also send the mail to the Robot Framework user group, so that the whole community can benefit from the answer.

-Tatu
Send from my mobile

On Dec 19, 2017 12:30, "Jeroen Wolff" <jeroen...@gmail.com> wrote:
Thanks Tatu!

When I try this 

Open Browser  http://demoapp.example.com  browser=chrome desired_capabilities=browserName:chrome remote_url=http://selenium-hub.example.com:80/wd/hub

But i'm not sure if i'm using the right syntax ;)

ValueError: chrome desired_capabilities=browserName:chrome remote_url=http://selenium-hub-ontwikkelteam-demo.cloudapps.ont.belastingdienst.nl:80/wd/hub is not a supported browser.


Thanks!

Reply all
Reply to author
Forward
0 new messages