How to make a check that the table with tips appeared after the autotest introduces Google there for example?
1 answer
If you just need to check that there are hints (without checking the correctness of the hints), then it is enough to get their number and check that it is greater than 0.
We define the locator of the element of the list of hints (the elements are "disk", "docs", etc.) and get a list of web elements. To get the list, you can use the visibility_of_element_located class, since it’s not enough for us to simply have elements in the DOM, we need them to be visible.
locator = (By.CSS_SELECTOR, 'ul > li') # просто пример, необходимо вставить свое значение timeout = 30 # время ожидания elements = WebDriverWait(driver, timeout).until(EC.visibility_of_element_located(locator)) assert elements |

WebDriverWait(driver, timeout).until(EC.presence_of_element_located(selector))- jfs