Skip to content Skip to sidebar Skip to footer

Is It Possible For WebDriver To Click An Element With A Mouseclick Event That Invokes A JavaScript File That Includes A Test Tracker?

This is a question I have that arises from another user's question. If you look at my answer there, you will get some context for this question. The URL for the web page I am going

Solution 1:

The problem is not the tracking or the click event, the problem is timing and possibly browser size. Maximize the browser window and add explicit wait when searching for the banner close button

browser = webdriver.Firefox(options=options)
browser.maximize_window()
browser.get(url)

wait = WebDriverWait(browser, 10)

wait.until(EC.element_to_be_clickable((By.ID, 'appd_wrap_close'))).click()
wait.until(EC.invisibility_of_element_located((By.ID, 'appd_wrap_default')))

current_page = int(browser.find_element_by_css_selector('a.current').text)
next_page = current_page + 1

page_number_field = wait.until(EC.visibility_of_element_located((By.ID, 'cPageNum')))
page_number_field.clear()
page_number_field.send_keys(next_page)
wait.until(EC.element_to_be_clickable((By.ID, 'cPageBtn'))).click()

Post a Comment for "Is It Possible For WebDriver To Click An Element With A Mouseclick Event That Invokes A JavaScript File That Includes A Test Tracker?"