from selenium import webdriver
import time

driver = webdriver.Chrome(executable_path='../Exercise/drivers/chromedriver.exe')
driver.maximize_window()
time.sleep(2)
driver.get('https://opensource-demo.orangehrmlive.com/')
print(driver.title)
print(driver.current_url)
driver.get('https://www.google.com')
driver.back()
time.sleep(2)
driver.forward()
time.sleep(3)
driver.refresh()
driver.back()
#commands on webelements
a1=driver.find_element_by_id('txtUsername')
a1.send_keys('satee143')
a2=driver.find_element_by_id('txtPassword')
a2.send_keys('9989884111')
btn= driver.find_element_by_id('btnLogin')
btn.click()
a1=driver.find_element_by_id('txtUsername')
a2=driver.find_element_by_id('txtPassword')
a2.send_keys('9989858000')
a1.send_keys('dusa.skumar')
print(a1.get_attribute('value'))
print(a2.get_attribute('value'))
btn= driver.find_element_by_id('btnLogin')
time.sleep(3)
a1.clear()
a2.clear()
time.sleep(3)
a1.send_keys('Admin')
a2.send_keys('admin123')
btn.click()
menu=driver.find_element_by_xpath('//*[@id="welcome"]')
menu.click()
print(menu.text)
driver.find_element_by_link_text("Logout").click()
