Web Driver Commands in Selenium Python – Selenium 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
Contents
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:
METHOD | DESCRIPTION |
---|---|
add_cookie | |
back | Goes one step backward in the browser history. |
close | Closes the current window. |
create_web_element | Creates a web element with the specified element_id. |
delete_all_cookies | |
delete_cookie | |
execute_async_script | Asynchronously Executes JavaScript in the current window/frame. |
execute_script | Synchronously Executes JavaScript in the current window/frame. |
forward | |
fullscreen_window | Invokes the window manager-specific ‘full screen’ operation |
get_cookie | |
get_cookies | |
get_log | Gets the log for a given log type |
get_screenshot_as_base64 | |
get_screenshot_as_file | Saves a screenshot of the current window to a PNG image file. |
get_screenshot_as_png | Gets the screenshot of the current window as a binary data. |
get_window_position | |
get_window_rect | Gets the x, y coordinates of the window as well as height and width of the current window. |
get_window_size | |
implicitly_wait | Sets a sticky timeout to implicitly wait for an element to be found, |
maximize_window | |
minimize_window | |
quit | Quits the driver and closes every associated window. |
refresh | |
set_page_load_timeout | Set the amount of time to wait for a page load to complete before throwing an error. |
set_script_timeout | |
set_window_position | Sets the x, y position of the current window. (window.moveTo) |
set_window_rect | |
current_url | Gets the URL of the current page. |
current_window_handle | |
page_source | Gets the source of the current page. |
title | Returns 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 |
1 thought on “Web Driver Commands in Selenium – Python Selenium In Hindi”