Posts

Showing posts from August, 2015

Python: Dictionary

Quick diving into "dictionary" of the python. Actually, this is example of code was written as a simple explanation for my little brother how to work with dictionary. This is simple example, without deep diving for many possible situations.

Python. How to handle CheckBox verification

Check-box verification in simple way. [code language="python"] from selenium import webdriver from selenium.webdriver.common.by import By driver = webdriver.Firefox() driver.get("http://blah_blah.com") try: elem= driver.find_element(By.NAME, "chk_email") if (elem.is_selected()): print("Checkbox is selected...now deselecting") elem.click() else: print("Checkbox is not selected..now selecting") elem.click() driver.close() except Exception as e: print ("Exception occurred", format(e)); finally: driver.quit() print ("done") [/code]