question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Waiting for the element availability & Visibility

See original GitHub issue

Expected Behavior

After an action like button click, we have to wait for the next element to be loaded and available for action

Actual Behavior

When a search operation is called from a ‘Search’ button click, I give sleep(seconds) with a tentative timing to delay the next line of code execution. If the search operation is taking more than the time to give results and the sleep(seconds) exceeded, automatically the next thing happens and goes ahead to click the ‘Reset’ button

Steps to Reproduce the Problem

N/A

Short Example of Code to Demonstrate the Problem

mainPanel.child_window(auto_id='searchButton', control_type='Button').click_input()
sleep(6)
ImageGrab.grab().save("results.png")
mainPanel.child_window(auto_id='resetButton', control_type='Button').click_input()

Specifications

  • Pywinauto version: 0.6.8
  • Python version and bitness: 3.7.4 64 bit
  • Platform and OS: Windows 10

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
vasily-v-ryabovcommented, May 23, 2020

BTW, it could be mentioned in the docs (I mean exception-less functions). Let’s keep it open.

1reaction
vasily-v-ryabovcommented, May 23, 2020

@jjbright Let’s take a look at the docs chapter Waiting for Long Operations. If you don’t need exception to be raised after timeout, there are methods exists(timeout=10) and method .is_visible() that both return bool value.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Step-by-Step Selenium: Wait Until Element Is Visible - Testim.io
Here's a common scenario when using Selenium: wait until an element is visible. Here, learn why waiting matters and how to do it....
Read more >
selenium wait for element-How to wait until an ... - Intellipaat
It will wait max 15 seconds for an element. As soon as element visible on the page, web driver will go for executing...
Read more >
Equivalent of waitForVisible/waitForElementPresent in ...
An implicit wait is to tell WebDriver to poll the DOM for a certain amount of time when trying to find an element...
Read more >
How to wait until an element is present in Selenium?
We can wait until an element is present in Selenium webdriver. This can be done with the help of synchronization concept.
Read more >
How to Resolve Expected Condition Failed Waiting ... - YouTube
#Solution - 7 | How to Resolve Expected Condition Failed Waiting For Visibility of Element Error |. 386 views 3 months ago.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found