-1

I am aware of the basic definitions of the three different waits in selenium - Implicit, Explicit and Fluent. Can anyone please explain the difference between Explicit wait and Fluent Wait. I understand we can add Polling Time and Exception handling in Fluent but have doubts as to when to exactly use which? Is there any help wrt Multithreading that can be achieved by using Explicit Wait?

abhishek pandey
  • 83
  • 1
  • 3
  • 13
  • http://toolsqa.com/selenium-webdriver/implicit-explicit-n-fluent-wait/ – Gautam Bothra Jul 27 '18 at 10:51
  • Guys Please don't share links as I have gone Through the basic definitions. I want to know when to use which wait and if Multi-threading has any role in the decision making?? – abhishek pandey Jul 27 '18 at 10:56
  • @DebanjanB I agree that this question is a kind duplicate but the other answer you have written doesn't explain well, actually a poor quality of answer and it doesn't cover what is the meaning of implicit wait. So please don't enter into the rage mode as usual , please remove duplicate tag. Atleast allow us to write the correct answer. – Rajagopalan Jul 27 '18 at 13:41
  • 1
    @DebanjanB Why are you duping this question to a dup? Why do both of the dups not have a selected answer but happen to have an answer by you in both cases? Why is your answer in both cases basically the same answer (and really, really, really long)? You should remove the dup of the dup and go fix your answer on the other to be more clear (and correct). – JeffC Jul 27 '18 at 13:55

1 Answers1

-1

There can be an instance when a particular element take more than a minute to load.In that case you definitely don't like to set a huge time for implicit wait as if you do this your browser will wait for the same time for every element. Hence we are going for explicit wait like thread.sleep() and webdriver wait()

Coming to fluent wait,it is a sub class of webdriver wait and I believe fluent wait is decommissioned from selenium 3.2 jar. Fluent wait is used at times when a element sometimes appears in a minute and sometimes it takes minutes to load and when it throws NoSuchElementException.

Hope this helps.

Fury
  • 142
  • 1
  • 12
  • Thread.sleep is not explicit wait! Fluent wait is not what you explained. Implicit wait has the boundary but it allows the action to be performed at the exact moment element exists in the screen. – Rajagopalan Jul 27 '18 at 13:17
  • 1
    Thread.sleep doesn't come under explicit wait?? Then what type of wait it is just curious to know! – Fury Jul 27 '18 at 13:19
  • Thread.sleep is the Java sleep statement you can use it to delay between one line of code to another line code. That's the normal sleep statement as any other program has the sleep statement. Explicit wait and implicit wait are not static wait. – Rajagopalan Jul 27 '18 at 13:25
  • @Rajagopalan : `Thread.sleep(1000)` is an extreme/worst kind of explicit wait which sets the condition to an exact time period to wait. you can refer this official link of selenium in which Selenium contributors have mentioned the same (https://www.seleniumhq.org/docs/04_webdriver_advanced.jsp#explicit-and-implicit-waits) – cruisepandey Jul 27 '18 at 17:24
  • @cruisepandey Ah okay , thanks. – Rajagopalan Jul 28 '18 at 02:02