Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can any one explain to me what is "to poll the DOM" in Selenium?

Whenever I am going through the concept of implicit wait and explicit wait concept in selenium most often I come across the sentence "to poll the DOM".What exactly it means?? I searched in google to find but I didn't find the relevant answer.

like image 951
Raja Ram Avatar asked Nov 27 '25 03:11

Raja Ram


2 Answers

It means to check the DOM repeatedly, on a set interval (every X milliseconds), to see if an element exists.

like image 102
Frank Modica Avatar answered Nov 28 '25 17:11

Frank Modica


Basically, when using implicit wait, your web driver will "check" for an element of the DOM for a certain amount of time. While when using explicit wait, it will wait until it finds the element. A more clear distinction and maybe what you need can be found in this article:

So, An explicit wait is code you define to wait for a certain condition to occur before proceeding further in the code. An implicit wait tells WebDriver to poll the DOM for a certain amount of time when trying to find an element or elements if they are not immediately available

like image 23
rbock Avatar answered Nov 28 '25 16:11

rbock



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!