I'm trying to import a python module to ride for more than 3 hours with no success. I went through the steps explained in fourth answer here where it suggests to create a python module Selenium2LibraryExt. How to get All Text in robot framework ?
the problem that i observe is that since i use Selenim2Library in my other codes of the same test now i import Selenium2LibraryExt which inherits from Selenim2Library, my test doesn't know anymore that e.g. Click Element keyword comesfrom Selenim2Library or Selenium2LibraryExt and it gives me multiple keyword error
So i did 1-I removed
from Selenium2Library import Selenium2Library
from the head of my python module but i let it stay as a library in my test case: settings
Library Selenium2Library
it didn't work out. 2-Then i removed
Library Selenium2Library
from my test case but added:
from Selenium2Library import Selenium2Library
in the head of my python module. but in both cases i get errors. how should i do not to have 2 selenium2library libraries seen by my test?
Thanks
If you go with a library that inherits, then your test data needs to import either Selenium2Library or your custom library, but not both. If you only import through a shared resource file, and not directly in the tests, this is easier to control.
Another option is to create a library that extends Selenium2Library without replacing it:
If you are using a recent version of Selenium2Library (>= 1.7), Get Webelement and Get Webelements allow you to do a lot of things there are not keyword for...
Same thing but getting the text using the extended variable syntax to work with a webelement.
Or in Python:
See also https://stackoverflow.com/a/35323931/2532697
So you can easily get around this by specifying the particular library you want to use. For example: