Advertisement
Guest User

Untitled

a guest
Jul 19th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. from selenium import webdriver
  2. from selenium.webdriver import ActionChains
  3. from selenium.webdriver.common.by import By
  4. from selenium.webdriver.common.keys import Keys
  5. from selenium.common.exceptions import NoSuchElementException
  6.  
  7. from selenium.webdriver.support.ui import WebDriverWait
  8. from selenium.webdriver.support import expected_conditions as EC
  9.  
  10. driver = webdriver.Chrome(executable_path=r'C:\ChromeDriver\chromedriver.exe')
  11. driver.get("https://login.imagesilo.com/Home/Login")
  12.  
  13. wait = WebDriverWait(driver, 10)
  14.  
  15. search_input = wait.until(EC.presence_of_element_located((By.ID, "txtPassword")))
  16. search_input2 = wait.until(EC.presence_of_element_located((By.ID, "txtUserName")))
  17.  
  18. cmd = "document.getElementById('txtUserName').value='2';"
  19. driver.execute_script(cmd)
  20.  
  21. elemental=driver.find_element_by_id("txtPassword")
  22. driver.execute_script("arguments[0].value = 'karp1';", elemental)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement