lundi 23 janvier 2017

Selenium cant find element? (automated web app)

Ive tried xpath, name , id but not sure why it wont work. Every time i try , it just says that it cannot find the element.

from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.support.ui import WebDriverWait 
from selenium.webdriver.support import expected_conditions as EC



def page_is_loaded(driver):
    return driver.find_element_by_tag_name("body") != None
driver = webdriver.Chrome('/Users/mattcasey/Desktop/SPLASHFORCE/chromedriver')
driver.get("http://ift.tt/2k7Z2RK               Site/en_GB/MyAccount-Register")
wait = WebDriverWait(driver, 10)
wait.until(page_is_loaded)
first_name_field = driver.find_element_by_name("profile_customer_firstname")
first_name_field.send_keys("Test")




Aucun commentaire:

Enregistrer un commentaire