0

I'm testing a web page. When I select something, then a pops up window appear

When the pops up window disappear automatically, then when I want to try click another button. Failed to click the button, though the button can be found.

Is there any method for python with selenium to get the button be focused? Since the last click is not happened

test link: https://www-01.ibm.com/products/hardware/configurator/americas/bhui/launchNI.wss

driver.get('www-01.ibm.com/products/hardware/configurator/americas/bhui/…) 
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 for SAP Apps 8 Skt Virt Unlimited Subs Only 5Yr (5731SLX)')]")
id=element1.get_attribute('for') 
driver.find_element_by_id(id).click()
driver.find_element_by_css_selector("img[alt=\"Continue\"]").click()
6
  • An example would be nice. What popup? Where? How is it created? What error message does you get? What code are you using? What browser? Commented Jul 10, 2013 at 9:15
  • My codes is like above. I've no idea about why there's no click event happen and also there's no any error msg @Arran Commented Jul 10, 2013 at 9:53
  • You last click operation is not calling the method. You have .click instead of .click(). Perhaps a typo but something to check at least. Commented Jul 10, 2013 at 14:29
  • @MarkRowlands, ah... that's a paste mistake. I've confirmed that ".click" is in my code. Commented Jul 10, 2013 at 14:47
  • Ok no worries. So the last click() isn't working. Is there an error or an exception? Commented Jul 10, 2013 at 15:23

2 Answers 2

1

I've checked my code, get the problem to the time-out resolved

changed from:

wait=ui.WebDriverWait(driver,10)

to:

wait=ui.WebDriverWait(driver,300)
wati.until(EC.staleness_of(driver.find_element_by_id("genMask_c")), 'visible')
Sign up to request clarification or add additional context in comments.

Comments

0

This is code is working for me and able to click Continue,i added only time.sleep and changed the object id locator

from selenium import webdriver

import time

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 for SAP Apps 8 Skt Virt Unlimited Subs Only 5Yr (5731SLX)')]")
id=element1.get_attribute('for')
driver.find_element_by_id(id).click()
time.sleep(70)
driver.find_element_by_id("continueBottom").click()
print 'done'

3 Comments

thanks. Just one more hmm... is there any method to confirm web page's status to instead of 'time.sleep'? –
@Stella you can make wait Until the IBM loading image disappears ..after that try to click on the continue button it should work
I've tried "wait until" to wait the image "Please wait..." not shown on UI, but always TimeoutException. Do u have any idea about it? Already, updated code as below answer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.