https://github.com/aditya-shrivastavv/selenium-scripts
https://github.com/aditya-shrivastavv/selenium-scripts
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/aditya-shrivastavv/selenium-scripts
- Owner: aditya-shrivastavv
- Created: 2023-09-07T07:33:29.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-08T10:59:28.000Z (over 1 year ago)
- Last Synced: 2025-01-29T13:09:26.826Z (4 months ago)
- Language: Python
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Selenium
## Methods
### Implicit Wait and Explict Wait
#### Implict
```py
driver.implicitly_wait(10)
```Sets a sticky timeout to implicitly wait for an element to be found, or a command to complete. This method only needs to be called one time per session.
#### Explicit
```py
from selenium.webdriver.support.ui import WebDriverWaitWebDriverWait(driver=driver, timeout=30).until(
EC.text_to_be_present_in_element(
(By.CLASS_NAME, "progress-label"), # Getting the element
"Complete!", # Expected text
)
)
```#### Implicit Wait VS Explicit Wait
- We can use implicit wait to find elements in the page
- We can use explicit wait to wait for some time untill some condition is met## Real Life Automation Example
- When you get an OTP for something, that OTP automatically gets detected and filled into the fields and submits