robotframework-extendedselenium2library icon indicating copy to clipboard operation
robotframework-extendedselenium2library copied to clipboard

Importing error with Robot Ver 3.0.2

Open Simpsonism opened this issue 8 years ago • 21 comments

has this library depricated over time? i am currently trying to import it into my project, using robot framework version 3.0.2 and it is failing to import this library.

my thoughts is that its due to Selenium2Library moving everything under SeleniumLibrary in version 3.0.0 or its specifically something with robot framework 3.0.2.

if its due to an incompatibility with robot v3.0.2 are there plans to update this so that it is compatible? i would really rather not have to write my own locators to add to robot for angular testing.

Error: [ ERROR ] Error in file 'C:\Workspace\Auto-Armor\comp.robot': Importing test library 'ExtendedSelenium2Library' failed: ImportError: cannot import name ElementKeywords Traceback (most recent call last): File "c:\python27\lib\site-packages\ExtendedSelenium2Library_init.py", line 27, in from ExtendedSelenium2Library.keywords import ExtendedElementKeywords File "c:\python27\lib\site-packages\ExtendedSelenium2Library\keywords_init_.py", line 24, in from ExtendedSelenium2Library.keywords.extendedelement import ExtendedElementKeywords File "c:\python27\lib\site-packages\ExtendedSelenium2Library\keywords\extendedelement.py", line 27, in from Selenium2Library.keywords import _ElementKeywords

Simpsonism avatar Dec 06 '17 20:12 Simpsonism

I just spent a couple of hours looking into this same issue. I thought I was doing something wrong (newbie to Python and RF). My colleague who installed ES2L with RF 1 or 2 weeks ago has it working but I cannot reach him right now (different time zone). It would be great if someone could post the last combination of package versions that is known to work.

For reference, installing all packages this morning resulted in this combination:

robotframework (3.0.2)
robotframework-extendedselenium2library (0.9.1)
robotframework-selenium2library (3.0.0)
robotframework-seleniumlibrary (3.0.0)
selenium (3.8.0)

cwienands avatar Dec 07 '17 16:12 cwienands

OK, I think I figured it out. 3 days ago, the robotframework-selenium2library 3.0 was officially released. That means, now if you install robotframework-extendedselenium2library it will install this version. Per the existing pull request https://github.com/rickypc/robotframework-extendedselenium2library/pull/17 ES2L is incompatible with the S2L 3.0 release. I tried to apply the changes from #17 on my system but that didn't work.

Instead, I used the following sequence to get the compatible versions installed:

pip install robotframework
pip install robotframework-selenium2library==1.8.0
pip install robotframework-extendedselenium2library

It is important to do the S2L 1.8 installation before ES2L in order to satisfy the minimum version required by ES2L yet use a compatible, older version.

cwienands avatar Dec 07 '17 17:12 cwienands

could you post what your installing packages resulted in after the adjustment? mine still is running into issues after uninstalling and reinstalling selenium and extended selenium

Simpsonism avatar Dec 08 '17 16:12 Simpsonism

I am using ES2L in Docker as well as on a Windows machine. Because the Alpine-based Docker image pulls an earlier version of Chromium (v53), I also needed to use an older version of Selenium, 3.3.1 to be specific. Therefore, my resulting packages look like this.

robotframework (3.0.2) robotframework-extendedselenium2library (0.9.1) robotframework-selenium2library (1.8.0) selenium (3.3.1)

What exactly are the issues that you are seeing? Can you post some output?

cwienands avatar Dec 08 '17 16:12 cwienands

I'm going to try and implement #17 real quickly and see if that works as i would like to be able to use the latest selenium update if possible. after i try that ill go back to what i was doing before and post the output

Simpsonism avatar Dec 08 '17 16:12 Simpsonism

i got it working now by reinstalling things making sure to use --no-cache-dir with pip. it was freaking out because it was installing robotframework-seleniumlibrary due to the cached directory. my resulting versions ended up as this:

robotframework (3.0.2) robotframework-extendedselenium2library (0.9.1) robotframework-selenium2library (1.8.0) selenium (3.8.0)

Simpsonism avatar Dec 08 '17 17:12 Simpsonism

Glad to hear you got it working. I had tried #17, too but it didn't work (didn't investigate much, though). Your versions look correct to me, assuming you are working with a recent version of Chrome. The difference to my environment is that I'm running in Docker with an older version of Chrome, hence Selenium 3.3.1.

cwienands avatar Dec 08 '17 18:12 cwienands

Hi All,

I'm very new to robotframework.

ALl set-up is done and my application is angular js based. After installing Angular js via pip, in eclipse(RED) - validating error is encountered. Same error for extendedselenium2library also.

Below is the config details: pip - 18.0 robotframework - 3.0.2 robotframework-angularjs - 0.0.8 robotframework-extendedselenium2library - 0.9.1 robotframework- selenium2library - 3.0.0 selenium2library - 3.1.1 Selenium - 3.14.0

please help to resolve my issue...

asief44 avatar Aug 14 '18 15:08 asief44

@asief44 Can you please post the content of those validation errors? Copy/pasted text + possibly a screenshot. I'm not using Eclipse and have pretty much no idea what you are talking about.

cwienands avatar Aug 14 '18 15:08 cwienands

Hi @cwienands, please find the attached screenshot of error. Issue in detail My application is angular js based, and unable to locate elements due to angular js calls. Tried installing robotframework-angularjs via pip and installation was successful, but after adding angularjs library into eclipse(RED), attached error is occurred.

robot_angularjs_error.docx

asief44 avatar Aug 14 '18 16:08 asief44

Please copy the error message(s) into a comment, and attach screenshots as .jpg or .png. Nobody here (incl. me) will want to open a .docx file from an unverified source.

cwienands avatar Aug 14 '18 16:08 cwienands

@cwienands, please find the below error and attached png file

Validating has encountered a problem. An internal error occurred while "validating" . \AngularJSLibrary\0273c5.lipspec(The system cannot find the file specified)

robotframework_angularjs_error

asief44 avatar Aug 14 '18 17:08 asief44

Hmm, does not look like the issue that Hakbutton and I have been discussing. I am not familiar with using RF from Eclipse, or using the AngularJS library. I recommend that you create a new post with exactly the information from your last post in another forum that deals with the AngularJS library. This will give you better visibility to others than hidden deep down in this post on a different issue and different technology (RF ExtendedSelenium).

cwienands avatar Aug 15 '18 13:08 cwienands

Thanks for the update @cwienands. Have posted in AnhularJS group.

I am facing same error/issue after adding extendedselenium2libarray as well, any suggesstions will be much appretiated.

asief44 avatar Aug 15 '18 13:08 asief44

@asief44, From my point of view, it could be the issue due to the lib doc is unable to generate or missing. You could try to generate the document by yourself as the guide here, you could create the lib doc with xml format, rename it as discribed in the error then copy it to libspecs folder in your project.

quan3c10 avatar Aug 16 '18 02:08 quan3c10

@quan3c10, thanks for the update. Tried creating a lipspec file with adding few items in xml format, still same issue exist. Any other suggestions??? or any other way to get the correct lipspec file???

asief44 avatar Aug 16 '18 12:08 asief44

@asief44, you have to generate the libdoc by the command in the guide Ex. python -m robot.libdoc "\Lib\site-packages\robotframework-extendedselenium2library" C:\robotframework-extendedselenium2library.xml

Then rename the "robotframework-extendedselenium2library.xml" to the name in the error message Ex. robotframework-extendedselenium2library_a0273c5.libspec

Then copy to the desire folder.

quan3c10 avatar Aug 17 '18 03:08 quan3c10

@quan3c10, many thanks for your inputs. I tried the suggestion to provided to generate libdoc, below error is displaying. Kindly help to resolve this issue. Thanks in Advance!

image

asief44 avatar Aug 23 '18 12:08 asief44

@asief44 Please check the folder path and make sure it exists, since the error is "File or directory does not exist". If the folder exists, please make sure the user have full permission and try to run the command with Administrator mode.

quan3c10 avatar Aug 24 '18 02:08 quan3c10

@quan3c10 , folder path is correct and ran the command prompt as administrator mode - Still getting same error.

asief44 avatar Aug 27 '18 13:08 asief44

@asief44 The tool works fine on my machine. It could be the problem with the Python setup location, since RED also unable to access the lib to get the keyword documentation.

I have some suggestions below:

  1. Uninstall Python, then reinstall it in C:\ folder then try again.
  2. Using RIDE instead of RED on Eclipse.

quan3c10 avatar Aug 28 '18 03:08 quan3c10