In [ ]:
pip install -U marigoso
In [3]:
from marigoso import Test
browser = Test().launch_browser("Firefox")
In [4]:
browser.get_url("http://pytestuk.blogspot.co.uk/2015/11/testing.html")
In [5]:
browser.press_available("id=cookieChoiceDismiss")
In [6]:
iframe = browser.get_element("css=div#bc_0_0T_box iframe")
browser.switch_to.frame(iframe)
In [7]:
browser.kb_type("id=commentBodyField", "An example of Selenium automation in Python.")
In [8]:
browser.select_text("id=identityMenu", "Google Account")
Out[8]:
After simulating the keyboard typing and dropdown selection, the page should now look like the image below:
In [9]:
browser.submit_btn("Publish")
After clicking the "Publish" button, the page will then be redirected to the Google Sign-in page. What goes beyond here is now an exercise for the reader. Please try it on your own. Write the next code that will automatically log you to your Google Account.
In [10]:
browser.quit()