Robot framework not picking up default keywords implementation

170 views
Skip to first unread message

anar...@gmail.com

unread,
Jul 3, 2017, 7:39:07 PM7/3/17
to robotframework-users
I'm trying to set up Robot on top of an Eclipse Maven-Selenium-TestNG java project I created, but I'm having problems and don't know what exactly is going on. These are the steps I followed:
1) I created a maven project and added selenium 3.4 dependency, testNG 6.8 dependency, robot 3.0.2 dependency and robot plugin 1.4.7 to my pom.xml, then updated project so maven downloads all the needed stuff. I tested testNG and selenium by creating a testNG class
in src>test>java and adding a simple test with a system property pointing to the chromedriver.exe in my machine, then opens a browser windows and navigates somewhere. This test passed. However, when I tried adding robot functionality something is not right:

2)
I created folders src/test/robotframework/acceptance

3) Added a file in that folder, with the following contents:
*** Settings ***

Test Set Up                         Start Selenium Server

Test Tear Down                      Stop Selenium Server


*** Test Cases ***

Visit google

  Open Browser  https://www.google.com  chrome

  Close Browser

This is what my pom.xml looks like:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
 
<modelVersion>4.0.0</modelVersion>
 
<groupId>org.example.automation</groupId>
 
<artifactId>automated_tests</artifactId>
 
<version>0.0.1-SNAPSHOT</version>
 
<dependencies>
     
<dependency>
     
<groupId>org.seleniumhq.selenium</groupId>
     
<artifactId>selenium-java</artifactId>
     
<version>3.4.0</version>
   
</dependency>
   
<dependency>
     
<groupId>org.testng</groupId>
     
<artifactId>testng</artifactId>
     
<version>6.8</version>
     
<scope>test</scope>
   
</dependency>
   
<dependency>
       
<groupId>org.robotframework</groupId>
       
<artifactId>robotframework</artifactId>
       
<version>3.0.2</version>
   
</dependency>
 
</dependencies>
 
<build>
   
<plugins>
     
<plugin>
       
<groupId>org.robotframework</groupId>
       
<artifactId>robotframework-maven-plugin</artifactId>
       
<version>1.4.7</version>
       
<executions>
         
<execution>
           
<goals>
             
<goal>run</goal>
           
</goals>
         
</execution>
       
</executions>
     
</plugin>
   
</plugins>
 
</build>  
</project>





However, when I run as maven install, I get:
Setup failed:
No keyword with name 'Start Selenium Server' found.

Also teardown failed:
No keyword with name 'Stop Selenium Server' found.

It doesn't seem to be picking up the keywords implementation... What am I missing?
 

Bryan Oakley

unread,
Jul 3, 2017, 7:44:38 PM7/3/17
to anar...@gmail.com, robotframework-users
"start selenium server" is from the old selenium library which is very, very out of date. You should be using the Selenium2Library instead. 

--
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.

anar...@gmail.com

unread,
Jul 4, 2017, 10:14:05 PM7/4/17
to robotframework-users, anar...@gmail.com
I see. And what's the "maven way" to do that? I tried adding a Library  Selenium2Library keyword to my test settings but then it says selenium can't be found:
[ ERROR ] Error in file 'C:\mypath\src\test\robotframework\acceptance\tests.robot': Importing test library 'Selenium2Library' failed: ImportError: No module named Selenium2Library
I know robotframework is installed using pip, but how does maven integrate with that? Shouldn't I just let maven download all the libraries the project needs?
Thanks.

Tatu Aalto

unread,
Jul 5, 2017, 2:47:44 AM7/5/17
to anar...@gmail.com, robotframework-users
Ugh

Well, your assumptions may not be totally correct. Robot Framework support Java (by using Jython) and many different Python variants. Also there is separate Maven plugin available[1]. The first thing you need to choose is which of the interpreter you want to use when you develop your test automation. Please note that not all libraries support all the interpreter which Robot Framework support and it's not possible and for some libraries there might be different versions for Jython and Python. And it might be possible to get some library working from a interpreter which they don't support by using the Robot Framework remote library interface [2]. So do some research what are your needs now and what you definitely need in near future and then decide which interpreter you need to use.

Once the above problem is sorted out and it's really important one, so please give it some thought. Also we might be able to guide you to the right direction if you can define what are your requirements for the test automation. But in any case, once you have answered to the question, it's easier to answer how you need to setup your environment. For example my work place is mostly Java shop, but we did choose go with Python because some things only exists in Python and the Java requirements I did get working by using the remote library interface.


Reply all
Reply to author
Forward
0 new messages