No keyword with name 'Add Location Strategy' found.

728 views
Skip to first unread message

kai

unread,
Feb 3, 2010, 4:14:05 PM2/3/10
to robotframework-users
Hi,

I'm using latest robot framework with the selenium library 2.2.2. I
have installed that on two computers. On the one I have successfully
run the test suites, but on the other machine I run into the FAIL:

No keyword with name 'Add Location Strategy' found.

I have checked the selenium.py script and on both machines the keyword
is there:

def add_location_strategy(self,strategyName,functionDefinition)

What lets the robot think it is not there? Other Selenium Library
calls are fine:

- Start Selenium Server -firefoxProfileTemplate, .\\lib\
\SeleniumFirefoxProfile
- Set Selenium Timeout 60 seconds
- Open Browser ${LOGIN URL}, ${BROWSER}

where processed successfully.

On both machines I'm running the script with Jython/Jybot.

Radek

unread,
Feb 3, 2010, 8:03:11 PM2/3/10
to robotframework-users
Add Location Strategy is not exposed as the keyword. I successfully
enabled JQuery strategy by customizing the library a little. I opened
an issue on that topic and provided a patch to allow new location
strategies. [http://code.google.com/p/robotframework-seleniumlibrary/
issues/detail?id=59]

You will have to modify selenium-library.jar to add some java script
code for the new location strategy. I did that for JQuery. More on my
blog: http://www.radekw.com/blog/2009/11/03/jquery-selectors-in-selenium/

I'm happy to hear that there is some interest in this functionality
and I hope the patch will make it to some next release.

--
Radek

Kai Hackemesser

unread,
Feb 3, 2010, 8:24:00 PM2/3/10
to robotframework-users
But we have done so before. Our Selenium-server.jar is already modified. The selenium.py script contains the method. Why isn't it found? It's not complaining about the keyword isn't not working, but it's not found

Kai

2010/2/4 Radek <rade...@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.


Kai Hackemesser

unread,
Feb 3, 2010, 8:35:24 PM2/3/10
to robotframework-users
Solved - I have missed to check __init__.py.
Thank you!
Kai

2010/2/4 Kai Hackemesser <kai.hac...@gmail.com>

Pekka Klärck

unread,
Feb 4, 2010, 4:36:15 PM2/4/10
to kai.hac...@gmail.com, robotframework-users
2010/2/3 kai <kai.hac...@gmail.com>:

>
> I'm using latest robot framework with the selenium library 2.2.2. I
> have installed that on two computers. On the one I have successfully
> run the test suites, but on the other machine I run into the FAIL:
>
> No keyword with name 'Add Location Strategy' found.
>
> I have checked the selenium.py script and on both machines the keyword
> is there:

The seleniumpy file included in the SeleniumLibrary is the Selenium RC
Python API. The actual keywords provided by the library are in the
SeleniumLibrary class that is created in __init__.py, and which
extends classes in other modules and thus includes methods from them
as keywords too.

As Radek already wrote, he has added an enhancement request about
exposing add_location_strategy method as a keyword [1] and also
written a blog post on how to enable jQuery selectors using it. As I
just wrote in a comment to the issue, I don't see any real problem in
adding that keyword into the next release, and we could even consider
bundling the jQuery selector support into the selenium-server.jar
distributed with the library.

[1] http://code.google.com/p/robotframework-seleniumlibrary/issues/detail?id=59
[2] http://www.radekw.com/blog/2009/11/03/jquery-selectors-in-selenium

Notice also that there's a separate enhancement idea about adding
`Call Selenium API` keyword to make it possible to call all the
Selenium RC methods even if they weren't exposed as "real" keywords.

[3] http://code.google.com/p/robotframework-seleniumlibrary/issues/detail?id=74

Cheers,
.peke

PS: It seems to me that SeleniumLibrary 2.2.3 is turning into 2.3.
--
Agile Tester/Developer/Consultant :: http://eliga.fi
Lead Developer of Robot Framework :: http://robotframework.org

Reply all
Reply to author
Forward
0 new messages