Robot-Framework and interactive python interpreter

195 views
Skip to first unread message

Dennis Marwood

unread,
Oct 18, 2013, 6:22:41 PM10/18/13
to robotframe...@googlegroups.com
Is there a way to use RF inside of the interpreter? My goal is to iteratively build a test (IE Driver only!) and have access to at least the webdriver element created.

So basically I would do the following:

1. Run RF and have my current test perform all the keywords it currently has.
2. Give me access to webdriver.
3. Then I would use selenium and RF to continue to build the test interactively.

Kevin O.

unread,
Oct 25, 2013, 4:48:09 PM10/25/13
to robotframe...@googlegroups.com
That certainly is possible, but I hope you are not thinking of using this as the primary method of test development.

*** Settings ***
Test Teardown     Close Browser
Library           Selenium2Library

*** Test Cases ***
Debug It
    Open Browser    http://www.google.com/    ie
    Evaluate    pdb.Pdb(stdout=sys.__stdout__, stdin=sys.__stdin__).set_trace()    pdb, sys


Kevin O.

unread,
Oct 26, 2013, 2:57:29 AM10/26/13
to robotframe...@googlegroups.com
I should mention that I have never used my posted method to develop tests, and I have some experience writing code against an IE-only web applications that had pages that were not reachable in Firefox. One workaround I have found useful for testing locators is to save the page source from Internet Explorer to a location being served by the World Wide Web Publishing Service. Then you can load the page in Firefox and use Firebug + Firepath.

David

unread,
Oct 26, 2013, 7:56:49 PM10/26/13
to robotframe...@googlegroups.com
If one is trying to test locators for/within IE, here's some useful info to know. You can query locators like with Firebug/FirePath in IE, and across other browsers too in a cross platform generic way, but it's most hassle-prone for IE due to lack of XPath support, if you were to want to test for XPath locators in IE.


but if you have a Selenium (Python) interpreter session already as Kevin shown, you can just do the test through that with browser being IE and skip all the prep work mentioned in my blog post. That post is more about tesitng outside of Selenium.

I tend to like to test locators first within browser, then may do a 2nd pass along with actual Selenium command (click/type, etc.) in an interpreter shell like Python. Though I don't use it with RF & Selenium2Library in a shell, just plain Python bindings for Selenium.
Reply all
Reply to author
Forward
0 new messages