In selenium how to access warnings window for information not found?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

In selenium how to access warnings window for information not found?

Reinaldo Chaves

In python 3 and selenium webdriver I have this program to enter codes in a website and store the information returned:

from selenium import webdriver

profile = webdriver.FirefoxProfile()
browser = webdriver.Firefox(profile)

# Site that is accessed

# Select year 2018

# Enter the code 07022473000139

# Stores the information found
company = browser.find_element_by_xpath('/html/body/form/div[3]/table/tbody/tr[2]/td/table/tbody/tr[3]/td/div/table/tbody/tr[2]/td[1]').text
value = browser.find_element_by_xpath('/html/body/form/div[3]/table/tbody/tr[2]/td/table/tbody/tr[3]/td/div/table/tbody/tr[2]/td[2]').text

# Go back one screen to do another search

I have a list of codes to search the site in the field: "CNPJ/CPF/Inscrição genérica/UGE favorecida :"

In this list I have already discovered that some codes do not exist in the site database (I do not know how many do not exist). And when I type a code that does not exist (like '07022473000136') a window opens on the site with the message "Não existe Credor com o filtro informado" and I can only continue by pressing the OK button

I did not find this warning message in the site code, so I still do not know how to handle it

Please, would anyone know how to test whether or not the code exists in selenium? And if not, how do I press the OK button to continue?

You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit
For more options, visit