Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 99026

Can you perform WebDriverWait in an ActionChain?

$
0
0

I often build ActionChains to interact with MUI components. Here is one that enters the date MM/DD/YYYY but ensures we start typing in the MM portion of the input. I have to wait for the animation of the field label to move out of the way before the input will accept anything.

actions = ActionChains(driver, duration=CHAIN_DURATION)actions.move_to_element(element)actions.click(element)actions.pause(.25) # animation of label to move out of the way.actions.send_keys(Keys.ARROW_LEFT)actions.send_keys(Keys.ARROW_LEFT)actions.send_keys(date_str)actions.send_keys(Keys.TAB)actions.perform()

mui component animation

The problem is this animation speed is variable (and it's not always known how fast each component will be). What I wish I had was the ability to perform a WebDriverWait.until(expected_condition) in the middle of the ActionChain. In this case I would wait until the label element (different from the input element) has stopped moving.Is this possible in some way?


Viewing all articles
Browse latest Browse all 99026

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>