Web Driver Commands in Selenium – Python Selenium In Hindi

Python Selenium

Web Driver Commands in Selenium PythonSelenium In Hindi – Is Post Me Ham Selenium Webdriver 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 Commands In Hindi

Jab Ham Automate Karte Hai Web Pages Ko To Hame Ye Check Karna Hota Hai, Ki Koi Web Pages Ka Title Ya Fir Screenshot Lena And Etc.. Ye Ham Web Driver Commands Se Check Kar Sakte Hai.

How to create an WebDriver Object ?

Ab Ham Webdriver Ka Ek Object Create Karte Hai And Ise Ham Example Ke Seth Dekhte Hai |

Example:

from selenium import webdriver
driver = webdriver.Chrome(executable_path= "D:\\chromedriver_win32\\chromedriver.exe")  #create object

Aap Upper Dekh Sakte Hai Ki Hamne Ek driver Name Ek Object Create Kiya Hai |

Also Read – How to Run Tests on Chrome

How to use Webdriver in Selenium ?

Ab Ham Ek Simple Web Driver Commands Ko Run Karne Wale Hai Jo Website Me Jane Ke Bad Ek Alert Function Ko Run Karega |

Example:

from selenium import webdriver
driver = webdriver.Chrome(executable_path= "D:\\chromedriver_win32\\chromedriver.exe")  #create object

# get 
driver.get("https://masterprograming.com/") 

# write script 
script = "alert('Welcome To MasterPrograming')"

# generate a alert via javascript 
driver.execute_async_script(script)

Output:

Webdriver Method Commands:

METHODDESCRIPTION
add_cookie
backGoes one step backward in the browser history.
closeCloses the current window.
create_web_elementCreates a web element with the specified element_id.
delete_all_cookies
delete_cookie
execute_async_scriptAsynchronously Executes JavaScript in the current window/frame.
execute_scriptSynchronously Executes JavaScript in the current window/frame.
forward
fullscreen_windowInvokes the window manager-specific ‘full screen’ operation
get_cookie
get_cookies
get_logGets the log for a given log type
get_screenshot_as_base64
get_screenshot_as_fileSaves a screenshot of the current window to a PNG image file.
get_screenshot_as_pngGets the screenshot of the current window as a binary data.
get_window_position
get_window_rectGets the x, y coordinates of the window as well as height and width of the current window.
get_window_size
implicitly_waitSets a sticky timeout to implicitly wait for an element to be found,
maximize_window
minimize_window
quitQuits the driver and closes every associated window.
refresh
set_page_load_timeoutSet the amount of time to wait for a page load to complete before throwing an error.
set_script_timeout
set_window_positionSets the x, y position of the current window. (window.moveTo)
set_window_rect
current_urlGets the URL of the current page.
current_window_handle
page_sourceGets the source of the current page.
titleReturns the title of the current page.

Upper Diye Gaye Functions Ko Ham Next Aani Wali Post Me Ek Ek Karke Cover Karne Wale Hai |

Also Read:

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