Giter VIP home page Giter VIP logo

Comments (10)

HelioGuilherme66 avatar HelioGuilherme66 commented on August 29, 2024 1

@gjemp You are using Selenium2Library with Python3, the official version only supports Python 2.6-2.7.
You may try the experimental build from my fork, command:
pip3 install --pre -U https://github.com/HelioGuilherme66/robotframework-selenium2library/archive/v1.8.0b3.zip

from red.

adam-wypych avatar adam-wypych commented on August 29, 2024

Hi,

You do not need to import every class. As I understand You are trying to add Selenium2Library to red.xml as Python library with setting the file name as C:\Python27\Lib\site-packages\Selenium2Library\__init__.py. I suggest You to add Selenium2Library to any resource or test case file and then try to save it (autodiscovery feature should found library and generate libspecs for Your self) or just use Quick Fix (shortcut key: Ctrl+1) options if error marker will occures on Library Selenium2Library.

For more information just put the following link to your web browser when RED is running:

http://127.0.0.1:56754/help/topic/org.robotframework.ide.eclipse.main.plugin.doc.user/doc/user_guide/libs.html?cp=2_3_1

from red.

adam-wypych avatar adam-wypych commented on August 29, 2024

Hello,

Any update?

Thanks and best regards,
Adam.

from red.

gjemp avatar gjemp commented on August 29, 2024

If I try to add "Selenium2Library/init.py" to red.xml in Refrence Library tab using Python library i get following :

RED was unable to find classes/modules inside 'C:/Users/.../AppData/Local/Programs/Python/Python35-32/Lib/site-packages/Selenium2Library/__init__.py' module
Python interpreter returned following errors:

Traceback (most recent call last):
  File "C:\Users\...\AppData\Local\Temp\RobotTempDir4703125963472295941\module_classes_printer.py", line 53, in <module>
    modules.append(loader.find_module(name).load_module(name))
  File "<frozen importlib._bootstrap_external>", line 385, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 806, in load_module
  File "<frozen importlib._bootstrap_external>", line 665, in load_module
  File "<frozen importlib._bootstrap>", line 268, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 693, in _load
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 662, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "C:\Users\...\AppData\Local\Programs\Python\Python35-32\Lib\site-packages\Selenium2Library\webdrivermonkeypatches.py", line 6, in <module>
    from .locators import WindowManager
SystemError: Parent module '' not loaded, cannot perform relative import

from red.

adam-wypych avatar adam-wypych commented on August 29, 2024

Did you install Selenium2Library via PIP?

from red.

gjemp avatar gjemp commented on August 29, 2024

yes

from red.

adam-wypych avatar adam-wypych commented on August 29, 2024

@HelioGuilherme66 thanks :) you are completly right :)
@gjemp without @HelioGuilherme66 I am not able even to install via PIP Selenium2Library

from red.

gjemp avatar gjemp commented on August 29, 2024

Still same. i think i have to downgrade :(

RED was unable to find classes/modules inside 'C:/Users/.../AppData/Local/Programs/Python/Python35-32/Lib/site-packages/Selenium2Library/__init__.py' module
Python interpreter returned following errors:

Traceback (most recent call last):
  File "C:\Users\...\AppData\Local\Temp\RobotTempDir4703125963472295941\module_classes_printer.py", line 53, in <module>
    modules.append(loader.find_module(name).load_module(name))
  File "<frozen importlib._bootstrap_external>", line 385, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 806, in load_module
  File "<frozen importlib._bootstrap_external>", line 665, in load_module
  File "<frozen importlib._bootstrap>", line 268, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 693, in _load
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 662, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "C:\Users\...\AppData\Local\Programs\Python\Python35-32\Lib\site-packages\Selenium2Library\webdrivermonkeypatches.py", line 6, in <module>
    from .locators import WindowManager
SystemError: Parent module '' not loaded, cannot perform relative import

from red.

adam-wypych avatar adam-wypych commented on August 29, 2024

Hello,

I think you need to add absolute path to C:\Users\...\AppData\Local\Programs\Python\Python35-32\Lib\site-packages to PYTHONPATH in red.xml. After this just run Autodiscovering on resource or test cases with setting Library Selenium2Library.
The second solution is to add absolute path to C:\Users\...\AppData\Local\Programs\Python\Python35-32\Lib\site-packages to PYTHONPATH in Your environment variables.

I tested this on my computer with package provided by @HelioGuilherme66 before I was installed selenium and references library via PIP.

from red.

gjemp avatar gjemp commented on August 29, 2024

Ok , it is working, it just does not work with my hybrid project :D After I created new red project it appeared without any problem :) Will try to find a way to add it to my hybrid project also :)

from red.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.