Questions tagged [expected-condition]

144 questions
1
vote
3 answers

Selenium find_elements only works if time passes since get()

Running these 2 lines together in Colab returns []: wd.get("https://wetransfer.com/") wd.find_elements(By.CSS_SELECTOR, 'input[type=file]') However, running one, followed by the other returns the expected…
rudolfovic
  • 3,163
  • 2
  • 14
  • 38
1
vote
2 answers

How can I set a dynamic explicit wait using Selenium in Python?

I got a little problem here with a program I built a few days ago, so I'm going to explain it very straightforward: I'm scraping data from a page with my program, and for doing so, I set this Explicit Wait: WebDriverWait(driver,…
1
vote
1 answer

waitTime not respected when Expected Condition fails in Selenium

I have the following sample code: try: element_found = WebDriverWait(driver, 10).until(EC.presence_of_element_located(By.XPATH,'//div[@class='sample-class'])) print("Success") except Exception: print("Failure") When the element is located…
1
vote
4 answers

What is the difference between some similar selenium waits?

Simple question: What is the exact difference between those two statements: WebDriverWait(self._driver, WEB_WAIT_TIMEOUT).until(ec.invisibility_of_element_located(element)) and WebDriverWait(self._driver,…
maxt026
  • 63
  • 10
1
vote
2 answers

how to wait for list of elements to be loaded in dynamic

i have a search box, when i do search a value, say a bank name, it displays the results matching the text given on the search box. But the catch here is it may not an exact result, and also it takes some seconds to load in a complete list, by…
mmar
  • 1,840
  • 6
  • 28
  • 41
1
vote
2 answers

Why is my selenium expected condition not working as the condition in the python if statement?

I have a function below that clicks the submit button on a form on my page. In order to successfully submit the form, a document must be attached. However, depending on how the database is linked sometimes, saved documents don't populate as already…
1
vote
0 answers

"Session expired" Error with Selenium Python in Chrome just immediately after very few seconds of logging in

I have a selenium program written in python. It has to login, load the page and the navigate to a certain page to do some functionalties. But, When I run the script using chrome, the script performs hardly any functioning, and gives a dialog box…
1
vote
1 answer

__init__() takes 2 positional arguments but 3 were given trying to wait for an element using presence_of_element_located()

The log throw me this : element.until(EC.presence_of_element_located(By.XPATH("//*[@id='menu-item-9145']/a'"))) TypeError: 'str' object is not callable Code trials: class Descaro: def __init__(self, driver): self.driver = driver …
1
vote
2 answers

selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: 'using' must be a string using waits and expected conditions

I am using Python 3.7 and Selenium 3.141.0. On slow-loading pages, it often helps to use code like this to capture DOM objects: myDiv = WebDriverWait(driver, 60).until( expected_conditions.presence_of_element_located((By.CSS_SELECTOR,…
1
vote
4 answers

Selenium - element is clickable but click still fails

This is my code do { try { wait.until(ExpectedConditions.elementToBeClickable(By.xpath(xpLand))); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } try { …
user10028942
1
vote
2 answers

How to scrape the data from the cricinfo website for commentary of the first innings of every match modifying a filter using Selenium and Python

Hey guys I have been trying to scrape some data from the cricinfo website for commentary of every match. I am able to get the full data for the second innings.. but unable to do so for the first innings as the drop-down present does not seem to have…
1
vote
4 answers

Java Automation Selenium findElement by xpath can't find object sometimes

I'm pretty new to Selenium and automation. I'm trying to do automation for simple health declaration form page: https://forms.office.com/Pages/ResponsePage.aspx?id=bGOiBG0y_0iT-HCYdb06qZZ8CdlEQAhOkRllU1E9dVZUMVk1VTZFWThQV1FQUTFUV0FKNkNOVldMSi4u To…
1
vote
4 answers

How to click on the Ask to join button within https://meet.google.com using Selenium and Python?

I am trying to click the Ask to join button in a google meet link(using my existing Google Chrome profile).This is the code: options =…
user14038734
1
vote
1 answer

How exactly do Protractor's ExpectedConditions work (related to behaviour on a non-angular site)?

In order to click a button I have to wait for an element to slide into the visible viewport. This works reliably: await browser.sleep( 1200 ); await btnToggleDeactivateQuestionnaire.click(); However, since I've learned that using "browser.sleep()"…