WebDriver Conditional Commands In Hindi – Selenium In Hindi

Python Selenium

WebDriver Conditional Commands In HindiPython Selenium In Hindi – Is Post Me Ham Selenium Webdriver Conditional Commands 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 Conditional Commands In Hindi

Jab Ham Automate Karte Hai Web Pages Ko To Hame Ye Check Karna Hota Hai, Ki Koi Elements Show Ho Raha Hai Ya Nhi And Ye Bhi Check Karna Hota Hai Enabled Hai Ya Nhi And Check Box Selected Hai Ya Nhi.

Ye Hame Conditional Commands Ki Help Se Check Kar Sakte Hai And Ise Examples Ki Help Se Ek Ek Conditional Commands Ko Output Ke Sath Check Kar Sakte Hai.

Conditional Commands:

  • is_displayed()
  • is_enabled()
  • is_selected()

Ab Ham Ek Ek Karke In Commands Ko Check Karne Wale Hai, And Inke Examples Ke Sath Inke Output Bhi Dekhne Wale Hai |

Also Read – How To Run Tests On Chrome

is_displayed() In Selenium

is_displayed() Functions Ka Istemal Ham Input Tags Ko Check Karne Ke Liye Karte Hai Ki Input Tags Display Hai Ya Nhi And Ye Results Me True And False Return Karta Hai |

Upper Diye Image me Email Input Tag Hai , Ise Ham Example Ke Sath Dekhne Wale Hai |

is_enabled() in Selenium

is_enabled() Function In Python Bhi Keval Yehi Check Karta Hai Koi Input Tags Ya Fir Others Enabled Hai Ya Nhi Results Me True And False Return Karta Hai |

is_displayed() and is_enabled Function Example Niche Diya Gaya Hai |

Example:

from selenium import webdriver

driver = webdriver.Chrome(executable_path= "D:\\chromedriver_win32\\chromedriver.exe")
driver.get("https://masterprograming.com/contact-us/")

var = driver.find_element_by_name("email")
print(var.is_displayed())  
print(var.is_enabled())

Output:

True
True

is_selected() In Selenium

is_selected() function in python Keval Ye Check Karta Hai ki Koi Button Select Hai Ya Nhi, Ise Ham Niche Diye Gaye Example Me Dekhte Hai, Waise Ye Results Me True And False Return Karta Hai |

Example:

from selenium import webdriver

driver = webdriver.Chrome(executable_path= "D:\\chromedriver_win32\\chromedriver.exe")
driver.get("https://www.w3schools.com/html/html_forms.asp")

var = driver.find_element_by_name("gender")
print(var.is_selected())
driver.quit()

Output:

False

Aap Output me Dekh Sakte Hai Ki Output False Aaya , Kyoki Upper Diye Image Me Koi Radio Button Select Nhi Hai, Isliye Output Me False Aaya Hai.

Also Read:

Friends Mujhe Umeed Hai Ki Aapko WebDriver Conditional 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 *