robotframework / OldSeleniumLibrary

Deprecated Selenium library for Robot Framework
Apache License 2.0
13 stars 3 forks source link

SeleniumLibrary requires GLOBAL_VARIABLES from robot.variable #111

Closed spooning closed 9 years ago

spooning commented 9 years ago

Originally submitted to Google Code by c.martin.taylor on 30 Mar 2010

I was trying to run SeleniumLibrary under RobotRemoteServer using a simple Python program like this:

import sys import SeleniumLibrary

if name == 'main': from robotremoteserver import RobotRemoteServer RobotRemoteServer(SeleniumLibrary.SeleniumLibrary(), *sys.argv[1:])

When I use this from a Remote library in pybot I get this error: FAIL - DataError: Non-existing variable '${LOG FILE}'

I believe that SeleniumLibrary should use try...except to catch errors like this and use some alternative if it finds that either Robot Framework is not installed or that Robot Framework is not being used to run Selenium Library.

If I get a chance later this week I may write some code to fix this issue and submit it as an attachment to this issue.

spooning commented 9 years ago

Originally submitted to Google Code by @pekkaklarck on 30 Mar 2010

There are many places where SeleniumLibrary uses RF's internal modules, especially utils, because we don't want to duplicate the code. It's probably easier to install RF on the remote machine than trying to take all all the dependencies. If installation isn't an option, you should be able to zip the robot module, copy it to the remote machine, and set the zip file into PYTHONPATH there.

spooning commented 9 years ago

Originally submitted to Google Code by c.martin.taylor on 31 Mar 2010

Actually I did have all of RF installed on the system where I was trying to run SeleniumLibrary as a remote server. If we accept, as Pekka suggests, that the use of RF modules is beneficial and required then there are two other problems:

  1. The RF built-in variable is ${LOG_FILE}, not ${LOG FILE}. Maybe this is insignificant and it works "by accident" when SeleniumLibrary is running under RF.
  2. When SeleniumLibrary is running under RobotRemoteServer, instead of the full RF, it seems that the ${LOG_FILE} variable is not available. This is probably also true for all other built-in RF variables like ${OUTPUTDIR}, etc.
spooning commented 9 years ago

Originally submitted to Google Code by @pekkaklarck on 31 Mar 2010

1) ${LOG_FILE} and ${LOG FILE} work the same way because spaces and underscores are ignored in variable names.

2) It's true that ${LOG FILE} and other similar variables are available only when tests are executed.

Do you actually need to run SeleniumLibrary remotely? Couldn't you just have the SeleniumServer running there and let the SeleniumLibrary on your local machine use it? You only need to specify different server address than the default localhost.

spooning commented 9 years ago

Originally submitted to Google Code by @pekkaklarck on 25 Apr 2010

Because it's possible to run just the Selenium Server remotely I don't think there's need to support running the whole library remotely.