Just over a month ago, I started transitioning from script development in Selenium/Perl to script development in Selenium/Python. I was flabbergasted by how much time I spent trying to find documentation on the Selenium/Python API! Finally, I located this very valuable wiki page.
My first response was to copy/paste the output of dir(selenium) into a file, and search in the file whenever I needed a particular type of method. Then (following the instructions on the Wiki page), I’d do a print selenium.method.__doc__ to get the full documentation on the method of interest. But that struck me as pretty cumbersome. I longed for a lengthy page full of method name and accompanying documentation, which I could search and read virtually simultaneously.
Then, while I was puzzling over what new assignment I could issue to my beginning Python students next class, it dawned on me. They could produce my longed-for full-length documentation page!
Here’s the teensy program that generates the Selenium-1/Python API:
from selenium import selenium for call in dir(selenium): str = "selenium." + call + ".__doc__" print call + ":" print eval(str)
And here’s the almost identical program that generates the (unfortunately, also teensy) Selenium-2/Python API:
from selenium import webdriver for call in dir(webdriver): str = "webdriver." + call + ".__doc__" print call + ":" print eval(str)
I can’t believe how long it took before I finally spent the 5 minutes necessary to develop a tool I really needed. SIGH!