Installing the examples¶
When the examples (for the tutorials) are not needed you can skip this article.
WebApp examples¶
For the ‘webapp’ examples a browser is needed, which is automated with ‘selenium’ (which is part of the gate). Several browser are supported, like Firefox and Chrome. For each browser-brand (& version), a specific browser-driver should be installed; aside of the generic selenium-software and the python (language) bindings.
The generic webgate is part of the framework, but should be configured to the selected browser and selenium-driver. And to compete, the examples themselves have to be installed 1.
- 1
That is: download and unpacked. When the “source” distribution is downloaded, the tests are already available (in
pathways-r-d/examples/calculators/webapp/tst/
).
Warning
Generic selenium software?
The documentation of selenium and related topics (bindings, drivers) is very-outdated.
Note to the Reader - Docs Being Revised for Selenium 2.0!
—http://www.seleniumhq.org/docs/00_Note_to-the-reader.jsp, Oct 2, 2016
Whereas the current version of selenium is 3.0.0-beta4. And the current firefox-browser (v49) is not compatible with older selenium versions.
At the moment it unclear if (or when) the “generic selenium software” is needed. Most probably, it is not (anymore). Or it comes automatically with the selenium-python language-bindings.
Whenever you installed as described below and it does not work, please install as described on http://www.seleniumhq.org/download/ And let me know, including details as symtoms and versions. –Thanks
Selenium¶
Tip
Verify script
Pathways comes with a small script (.../bin/VerifySelenium_Firefox.py
) to verify Selenium is correctly
installed, including browser, drivers, and language-bindings; currently only for Firefox (this will change soon).
Run it like:
[albert@Python3:]% python3 {options} VerifySelenium_Firefox.py PATH/TO/DRIVER
It will step-for-step verify all details and give tips when it fails. When all works, the browser is started and
one page is visited. You can visually verify this. At the end, that browser (session) is closed.
To show it options: run:
[albert@Python3:]% python4 VerifySelenium_Firefox.py --help
Install the selenium-python bindings:
[albert@Python3:]% pip3 install --upgrade selenium
Browser & driver¶
Firefox¶
Install Firefox
The Gecko driver: https://github.com/mozilla/geckodriver/releases
Chrome¶
Install Chrome
Install the ChromeDriver: https://sites.google.com/a/chromium.org/chromedriver/downloads
Other (browsers & version)¶
The procedure for other browsers is described in the selenium documentation. As browsers and selenium tend to change frequently, is sensible to have a look on that site, as well on stackoverflow.
configure & WebApp test¶
Todo
make browsers & driver selectable
Warning
Currently, the config files (and even some code!) contain hardcoded paths. That is a known error….
But as I am the main user, it will do for now. :-)
A rewrite/update of the
core/conf
is needed.
download and unpack the examples
Todo
Make the examples (zip-file) downloadable, and document it.