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.

Why does implicit wait not take effect?

See original GitHub issue

I used command to change UI in my project. For example:

<ListView
 ...
 ItemsSource="{x:Bind ViewModel.ExpandedLevels}">
 <ListView.ItemContainerTransitions>
  <TransitionCollection />
 </ListView.ItemContainerTransitions>

 <ItemsControl.ItemsPanel>
  <ItemsPanelTemplate>
   <VirtualizingStackPanel>
   ...
   </VirtualizingStackPanel>
  </ItemsPanelTemplate>
 </ItemsControl.ItemsPanel>
 <ItemsControl.ItemTemplate>
 ...
 </ItemsControl.ItemTemplate>
</ListView>
public ICommand SelectItemCommand { get; }

I wanted to use implicit wait to solve the display delay problem. But did not take effect. I think it may be because the implicit wait may only take effect when the Page control switches. Or does it take effect every time when finding elements?

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
Tree55Topzcommented, May 19, 2020

@kram95731 this approach worked for me (C#). The key is to include it with the instantiation of your driver session. Best of luck

session = new WindowsDriver<WindowsElement>(new Uri(WindowsApplicationDriverUrl), appCapabilities, TimeSpan.FromMinutes(2));

0reactions
kram95731commented, May 21, 2020

@kram95731 this approach worked for me (C#). The key is to include it with the instantiation of your driver session. Best of luck session = new WindowsDriver<WindowsElement>(new Uri(WindowsApplicationDriverUrl), appCapabilities, TimeSpan.FromMinutes(2));

Thanks for your suggestion. I have found the cause of problem. The element was found but the number is wrong. For example:

HTTP/1.1 200 OK
Content-Length: 102
Content-Type: application/json

{"sessionId":"3B1ABD33-B1F1-4CFE-85C1-7284A8F00A4D","status":0,"value":[{"ELEMENT":"42.462094.4.96"}]}

WinAppDriver returned one element.

Driver.FindElementsByClassName("GridView").Single(list => list.GetAttribute("AutomationId").Equals(...))

But in my code, I try to find more than one element. So the error happened. WinAppDriver did find the element. So it returned. However at that time, there should be two elements or more.

Thank you all the same.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Selenium implicitlyWait Not Working?
Implicit Wait and Explicit Waits doesn't work that way, they will maximum wait for element for the time duration specified, If they find...
Read more >
Waiting Strategies
Warning: Do not mix implicit and explicit waits. Doing so can cause unpredictable wait times. For example, setting an implicit wait of 10 ......
Read more >
Are You Mixing Waits In Selenium WebDriver? – A Bad ...
Warning: Do not mix implicit and explicit waits. Doing so can cause unpredictable wait times. For example, setting an implicit wait of 10 ......
Read more >
Implicit Wait vs Explicit Wait in Selenium Webdriver
An implicit wait is a global setting that applies to all elements in a Selenium script. It waits a specified time before throwing...
Read more >
Selenium Wait Commands: Implicit, Explicit, and Fluent Wait
Setting Explicit Wait is important in cases where there are certain elements that naturally take more time to load. If one sets an...
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