wgnet / webium

Webium is a Page Object pattern implementation library for Python (http://martinfowler.com/bliki/PageObject.html). It allows you to extend WebElement class to your custom controls like Link, Button and group them as pages.
Apache License 2.0
161 stars 37 forks source link

ImportError: No module named controls.link #9

Closed ragred closed 8 years ago

ragred commented 8 years ago

Newbie question... Installed webium 1.0.7 on Windows workstation running Python 2.7.9. When trying to run the basic usage example I get error

Traceback (most recent call last): File "webium.py", line 4, in from webium.controls.link import Link File "C:\Users\tiko\PycharmProjects\webium\webium.py", line 4, in from webium.controls.link import Link ImportError: No module named controls.link

Don't know what to do...?

ufranske commented 8 years ago

It looks like your issue is related to namespace resolution. Your module has the same name (webium.py) as webium package does. So, your module doesn't see webium's package. In order to resolve this issue in Python you can:

1) rename your module 2) add from __future__ import absolute_import to the beginning of your module

ragred commented 8 years ago

Changing the filename did the trick, thank you x)