WebDriver Implicit And Explicit wait In Hindi

Python Selenium

WebDriver Implicit And Explicit wait In Hindi Python Selenium In Hindi – Is Post Me Ham Selenium WebDriver Implicit And Explicit wait Ko Dekhne Wale Hai Or Inke Example Bhi Dekhte Hai |

Yadi Aapne  HTML Full Course  And CSS Full Course And Python Full Course And PHP Full Course Nhi Read Kiya Hai To Aap Vah Bhi Read Kar Sakte Hai |

WebDriver Implicit And Explicit wait In Hindi

Is Time Ke Website Me Jyada Tar Ajax Techniques Ko Web Apps Me Istemal Kiya Jata hai,Or Web Pages Jo Loaded Hota Hai Wo Browser Se Hota Hai, Or Wo Element Ya Pages Load Hone Me Different Time Le Sakta Hai Hai,

Selenium Se Wait Ko Handel Karne Ke Liye 2, Implicit And Explicit Wait Commands Ko Privode Karti Hai, Inhe Ham Ek Ek Karke Inke Example Ko Understand Karte Hai |

Explicit Wait Commands In Hindi

Explicit Wait Ek Commands Hai, Jise Aap Code Me Aage Badhne Se Pahle Wait Ko Implement Karte Hai, Waise Python Me time.sleep() Karke Bhi Wait Kiya Ja Sakta Hai, Joki time.sleep() Me Jitna Aap Time Second Me Dete Hai Wo Utna Hi Wait Karta Hai,

Lekin Selenium Isko Aapne Aap Bhi Khud Handel Kar Sakta Hai, Iski Ek Commands Hai, WebDriverWait ExpetedCondition Se Bhi Wait Kiya Ja Sakta Hai |

Example:

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

driver = webdriver.Chrome(executable_path="E:\\chromedriver_win32\\chromedriver.exe")
driver.get("https://masterprograming.com/")
try:
    element = WebDriverWait(driver, 10).until(
        EC.presence_of_element_located((By.ID, "site-navigation"))
    )
    print("Jab Website Ka Navigation Load Ho Gaya To Me Exit Ho Gaya Hu.... hahaha ")
finally:
    driver.quit()

Aap Upper Diye Code Ko Dekh Sakte Hai, Isme Hamne WebDriverWait Ke under , driver diya hai And 10 Sec Time Diya Hai, Or Jab Tak Wait Karne Ke Liye Bola Hai, Tab Tak site-navigation Load Na Ho Jaye |

Output:

Jab Website Ka Navigation Load Ho Gaya To Me Exit Ho Gaya Hu.... hahaha 

More Function:

  • title_is
  • title_contains
  • presence_of_element_located
  • visibility_of_element_located
  • visibility_of
  • presence_of_all_elements_located
  • text_to_be_present_in_element
  • text_to_be_present_in_element_value
  • frame_to_be_available_and_switch_to_it
  • invisibility_of_element_located
  • element_to_be_clickable
  • staleness_of
  • element_to_be_selected
  • element_located_to_be_selected
  • element_selection_state_to_be
  • element_located_selection_state_to_be
  • alert_is_present

Implicit Wait Commands In Hindi

Implicit Wait Ka Istemal WebDriver Ko Poll Ya Fir DOM Ko Certian Amout Of Time Ke Liye Find Karta Hai Kisi Elements Ko , Ya Fir Turant Available Nhi Hone Wale Elements Ko, Waise Iski Defualt Setting Zero Hoti Hai, And Agar Iski Setting Ek Bar Change Kardi Jaye To Ye Life Time Ke Liye Set Ho Jati Hai |

Example:

from selenium import webdriver

driver = webdriver.Chrome(executable_path="E:\\chromedriver_win32\\chromedriver.exe")
driver.implicitly_wait(10) # seconds
driver.get("https://masterprograming.com/")
myDynamicElement = driver.find_element_by_id("site-navigation")
print("Bhai Sab Kuch Sahi Hai....")

driver.quit()

Output:

Bhai Sab Kuch Sahi Hai....
[Finished in 18.1s]

Friends Mujhe Umeed Hai Ki Aapko WebDriver Commands Ke Bare Mai 100% Jankari Ho Gayi Hogi | Agar Aapko Learn Karne Main Dikkat Aa Rahi Hai To Aap Mere Se Contact Kar Sakte Hai |

Leave a Reply

Your email address will not be published. Required fields are marked *