Web Application Automation
Project - 02.02.20
Using Python, an online tool was automated to be run with different input data.
This was accomplished with the Selenium module. The website tool that is being automated is PVGIS, a photovoltaic (PV) panel (solar power) energy yield estimator. This tool was developed by the European commission. When given simple inputs such as location, capacity, the panel azimuth, and tilt (and others), a rough estimate of energy yield of the panel is calculated.
PVGIS does not support running multiple simulations at once which one might want to do if they had multiple sites, or multiple orientations of panels etc. In this project, a single site has been run with different panel orientations (azimuth and tilt) to find the optimum. PVGIS does already have an orientation optimizer, but we will ignore this as this project is about automation, not what is being automated.
The video below shows the automation process in action:
Video showing the PVGIS automation process.
The Code: Overview of Process.
- A "webdriver" is first set up to perform the automation process on the web.
- The process is made slightly slower by first having to accept cookies.
- The time module was used at various points to give the webdriver a chance to load before continuing (the source of many bugs).
- A Pandas dataframe is set up for the scenarios. Azimuth angle is investigated between ±30 at 15° intervals. Tilt is investigate from 15° to 45° at 10° intervals. This gives 20 total azimuth/tilt combinations.
- The scenarios are then repeatedly run and the annual energy yield results are stored in the Pandas dataframe
- The webdriver is then closed.
- The Seaborn module is then used to plot azimuth/tilt vs annual energy yield (see below).
Results of the optimization for a 1Â kW system. The result corresponds to the PVGIS omptimisation result.
Notes
The above example is, of course, redundant because of PVGIS's azimuth/tilt optimisation tool. However, it is a good demonstration of a the method which could be applied elsewhere.