get time out exception when wati.until excute. i've no idea why it, since img element not shown user when refresh web page.
wait.until(ec.invisibility_of_element_located((by.xpath,"//img[@src='//www.ibm.com/i/c.gif']"))) raise timeoutexception(message) selenium.common.exceptions.timeoutexception: message: ''
here's code:
from selenium import webdriver selenium.common.exceptions import timeoutexception selenium.webdriver.support.ui import webdriverwait # available since 2.4.0 selenium.webdriver.support import expected_conditions ec # available since 2.26.0 selenium.webdriver.common.by import import selenium.webdriver.support.ui ui driver=webdriver.firefox() driver.get('https://www-01.ibm.com/products/hardware/configurator/americas/bhui/launchni.wss') driver.find_element_by_id("modelnumber").send_keys("7383ac1") driver.find_element_by_name("submit").click() element1 = driver.find_element_by_xpath("//label[contains(text(),'sles sap apps 8 skt virt unlimited subs 5yr (5731slx)')]") id=element1.get_attribute('for') driver.find_element_by_id(id).click() #updated wait until wait.until(ec.invisibility_of_element_located((by.xpath,"//img[@src='//www.ibm.com/i/c.gif']")))
resolved problem, modifing codes below:
driver=webdriver.firefox() driver.get('https://www-01.ibm.com/products/hardware/configurator/americas/bhui/launchni.wss') driver.find_element_by_id("modelnumber").send_keys("7383ac1") driver.find_element_by_name("submit").click() element1 = driver.find_element_by_xpath("//label[contains(text(),'sles sap apps 8 skt virt unlimited subs 5yr (5731slx)')]") id=element1.get_attribute('for') driver.find_element_by_id(id).click() print driver.title wait=ui.webdriverwait(driver,300) image1=driver.find_element_by_xpath("//img[@src='//www.ibm.com/i/c.gif']") print image1.get_attribute('class') div1=driver.find_element_by_id("genmask_c") wati.until(ec.staleness_of(driver.find_element_by_id("genmask_c")), 'visible') driver.find_element_by_id("continuetop").click() print driver.title
Comments
Post a Comment