open browser keyword not found

4,476 views
Skip to first unread message

pohleng teoh

unread,
May 10, 2016, 3:11:26 AM5/10/16
to robotframework-users
Hi,

I am new to robot framework. I just finished installing all the necessary components following the instruction in the robotframework page.

first I install Python 2.7, then I install selenium. After that I ran

pip install robotframework

and then

pip install robotframework-selenium2library
 
both successfully.

Below is the version


C:\Python27>pip install -U robotframework-selenium2library
Requirement already up-to-date: robotframework-selenium2library in c:\python27\lib\site-packages
Requirement already up-to-date: decorator>=3.3.2 in c:\python27\lib\site-packages (from robotframework-sel
enium2library)
Requirement already up-to-date: selenium>=2.32.0 in c:\python27\lib\site-packages (from robotframework-sel
enium2library)
Requirement already up-to-date: robotframework>=2.6.0 in c:\python27\lib\site-packages (from robotframewor
k-selenium2library)
Requirement already up-to-date: docutils>=0.8.1 in c:\python27\lib\site-packages (from robotframework-sele
nium2library)
Cleaning up...


When I try to run a very simple test as below

===
***  Setting ***
Documentation  This is blah
Library  Selenium2Library


*** Variables ***

*** Test Cases ***
User must sign in to check out
    [Documentation]  This is blah
    [Tags]  Smoke
    Open Browser  http://www.amazon.com ie
    Close Browser
=====

I got a failed result as below


<<< Test Log >>>
TEST User must sign in to check out
Full Name: Test2.User must sign in to check out
Documentation:

This is blah

Tags: Smoke
Start / End / Elapsed: 20160510 14:59:04.875 / 20160510 14:59:04.883 / 00:00:00.008
Status: FAIL (critical)
Message: No keyword with name 'Open Browser' found.
00:00:00.000 KEYWORD Open Browser http://www.amazon.com, chrome
Start / End / Elapsed: 20160510 14:59:04.882 / 20160510 14:59:04.882 / 00:00:00.000
14:59:04.882 FAIL No keyword with name 'Open Browser' found.


Any idea what might have gone wrong with my installation ? Thanks for your help.

Nesat Ufuk

unread,
May 10, 2016, 5:05:55 AM5/10/16
to robotframework-users
Note, that you will encounter strange behavior, if you open
        multiple Internet Explorer browser instances. That is also why
        `Switch Browser` only works with one IE browser at most.
        For more information see:
        http://selenium-grid.seleniumhq.org/faq.html#i_get_some_strange_errors_when_i_run_multiple_internet_explorer_instances_on_the_same_machine

Can you try with another browser like firefox and/or chrome.

Kevin O.

unread,
May 10, 2016, 11:59:33 AM5/10/16
to robotframework-users
Welcome to the Robot Framework community.

The problem is the extra space in your Setting header. Should be
*** Setting ***
not
***  Setting ***

Robot Framework is not "seeing" the Setting table and so not importing the library.
I think the framework is designed to ignore extra stuff in case people want to put custom content in the data sources.
Robot Framework is flexible with the spaces between items in each table, but apparently picky about the header.
This was news to me as I use RIDE and let it format the data files.

Kevin

Kevin O.

unread,
May 10, 2016, 12:20:14 PM5/10/16
to robotframework-users
You may have hit a regression. Your format seems valid according to the User Guide:

The test data tables must have one or more asterisk before their names similarly as in the TSV format. Otherwise asterisks and possible spaces in the table header are ignored so, for example, *** Settings *** and *Settings work the same way. Also similarly as in the TSV format, everything before the first table is ignored.

Bryan Oakley

unread,
May 10, 2016, 12:51:34 PM5/10/16
to korm...@gmail.com, robotframework-users
This definitely looks like a bug in robot. If there's one space after the asterisks it works OK, but if there's two spaces it does not. I can reproduce this with both robot 2.9.1 and 3.0. 

On Tue, May 10, 2016 at 11:20 AM, Kevin O. <korm...@gmail.com> wrote:
You may have hit a regression. Your format seems valid according to the User Guide:

The test data tables must have one or more asterisk before their names similarly as in the TSV format. Otherwise asterisks and possible spaces in the table header are ignored so, for example, *** Settings *** and *Settings work the same way. Also similarly as in the TSV format, everything before the first table is ignored.

--
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-u...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at https://groups.google.com/group/robotframework-users.
For more options, visit https://groups.google.com/d/optout.

pohleng teoh

unread,
May 11, 2016, 12:10:29 AM5/11/16
to robotframework-users
Thanks Kevin. The Open Browser keyword not found error has been resolved now after remove the space before Setting. The Open Browser is working and I can see the firefox browser opening up.

[ WARN ] Keyword 'Capture Page Screenshot' could not be run on failure: No browser is open
User must sign in to check out :: This is blah                        | FAIL |
WebDriverException: Message: Can't load the profile. Profile Dir: c:\users\acer\appdata\local\temp\tmpvwey
tv\webdriver-py-profilecopy If you specified a log_file in the FirefoxBinary constructor, check it for det
ails.

pohleng teoh

unread,
May 11, 2016, 12:14:51 AM5/11/16
to robotframework-users

I am getting a different error now as below. The URL that I pass to the open browser keyword doesn't work as the page is not being loaded.


[ WARN ] Keyword 'Capture Page Screenshot' could not be run on failure: No browser is open
User must sign in to check out :: This is blah                        | FAIL |
WebDriverException: Message: Can't load the profile. Profile Dir: c:\users\acer\appdata\local\
temp\tmpvwey
tv\webdriver-py-profilecopy If you specified a log_file in the FirefoxBinary constructor, check it for det
ails.


pohleng teoh

unread,
May 11, 2016, 7:51:28 PM5/11/16
to robotframework-users
I have managed to get this to work now after I downgrade my Firefox from 47 to 45.   :)

Pekka Klärck

unread,
May 12, 2016, 2:51:12 PM5/12/16
to ombre42, robotframework-users
Thanks Kevin for pointing out I accidentally replied only to him. My
original reply to him is below.

And before anyone asks, the reason we haven't configured this list to
reply-to-all automatically is explained here:
http://producingoss.com/en/message-forums.html#reply-to

2016-05-12 10:31 GMT+03:00 Pekka Klärck <pe...@iki.fi>:
> The framework actually works as designed but the User Guide doesn't
> explain this too well at least in the quoted text. What happens is
> that the header line is first split into columns from any occurrence
> of two or more spaces and then the actual table/section header is
> expected to be in the first column. In this case the first column
> contains just `***` and thus the table is not recognized.
>
> I am first to admit that although the behavior is designed it far from
> good. The reason for the design is that same logic is used for parsing
> all test data tables regardless is the data in plain text, TSV or HTML
> format. Special casing the plain text format would be possible, but I
> would rather consider dropping support from other formats so that
> parsing could be streamlined also otherwise.
>
> What do people on this list think, should we consider dropping support
> of TSV and HTML formats? I doubt TSV support would be a big loss
> because TSV files could be parsed by the plain text parser with very
> small limitations (empty cells needed to be escaped), but there would
> be no real substitute for possibly removed HTML format. The main
> question is, are there still users who prefer HTML over plain text and
> have good use cases for it?
>
> Cheers,
> .peke
> --
> Agile Tester/Developer/Consultant :: http://eliga.fi
> Lead Developer of Robot Framework :: http://robotframework.org

Bryan Oakley

unread,
May 12, 2016, 3:12:05 PM5/12/16
to robotframework-users
> What do people on this list think, should we consider dropping support
> of TSV and HTML formats?

I'm in favor of removing HTML format. TSV seems dangerous -- doesn't RIDE save in TSV? Though, if TSV got dropped it wouldn't affect me at all; the last three companies where we used robot all used the plain text format. 

I'm in favor of removing HTML because I think it's existence slows down the progress of robot.  I remember years ago (2012) having a discussion about preserving line numbers during parsing, and the response was essentially "we won't add it unless we support it in all formats" which was just too big of a project for me to tackle. I submitted a PR for the plain text formats, but it never got accepted (or even acknowledged). Removing HTML removes one hurdle for enhancements such as this.

Are you considering dropping rst as well? I have no opinion on that, other than I think it causes the same problems as HTML - it requires more effort to support, and potentially slows down progress on the other formats. 


Vinicius Kwiecien Ruoso

unread,
May 13, 2016, 7:51:13 AM5/13/16
to bryan....@gmail.com, robotframework-users
I'm also in favor of removing the HTML format, unless there are really
good use cases for it. reST in the other end is really useful, and as
far as I know the implementation is quite simple (all plain text
enhancements are automatically applied to rst format).

Tatu Aalto

unread,
May 13, 2016, 11:28:57 AM5/13/16
to Vinicius Kwiecien Ruoso, Bryan Oakley, robotframework-users

Ugh

We don't currently use the HTML and TSV formats for anything. So can be removed from your point of view.

-Tatu

Pekka Klärck

unread,
May 16, 2016, 3:32:33 PM5/16/16
to Vinicius Kwiecien Ruoso, Bryan Oakley, robotframework-users
2016-05-13 14:51 GMT+03:00 Vinicius Kwiecien Ruoso <viniciu...@gmail.com>:
> I'm also in favor of removing the HTML format, unless there are really
> good use cases for it. reST in the other end is really useful, and as
> far as I know the implementation is quite simple (all plain text
> enhancements are automatically applied to rst format).

I don't see any benefits in removing the support for embedding Robot
Framework data into reST documents. This feature has some really nice
use cases and, as you pointed out, implementation is simple. I could
consider not parsing reST files automatically or at least having an
option to disable parsing them, though, to avoid parsing large reST
files when they contain no test data.

AKS

unread,
Oct 17, 2017, 7:23:16 AM10/17/17
to robotframework-users
Hi All,

I had the same issue. what I found was that there must be space after Open Browser selenium Keyword. For eg: (see below), adding the url AND browser in variables helped as the keywords are now highlighted and ROBOT can see it.  

*** Settings ***

Documentation     A resource file with reusable keywords and variables.

...

...               The system specific keywords created here form our own

...               domain specific language. They utilize keywords provided

...               by the imported Selenium2Library.

Library           Selenium2Library


*** Variables ***


${BROWSER}        Firefox

${LOGIN URL}      http://www.google.com/


*** Test Cases ***


User must sign in to check out

    [Documentation]    This some basic information about the test 

    [Tags] 

    Open Browser    ${LOGIN URL}    ${BROWSER}

    Close Browser 

    


*** Keywords ***

Reply all
Reply to author
Forward
0 new messages