Тёмный

Selenium 4 Beginner Tutorial 3 | Waits 

Automation Step by Step
Подписаться 528 тыс.
Просмотров 24 тыс.
50% 1

Опубликовано:

 

7 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 43   
@Varun-A
@Varun-A Год назад
Your tech teaching style is really effective. I'm learning so much
@RaghavPal
@RaghavPal Год назад
Glad you think so!
@JuazNeto
@JuazNeto Год назад
That is a great playlist of teachings. Thank you very much 🙏
@RaghavPal
@RaghavPal Год назад
You are very welcome Juaz
@atkuriajaykumar3701
@atkuriajaykumar3701 2 года назад
Thanks raghav , for explaining about different types of waits and explaining fluent wait difference also , thanks a ton !
@RaghavPal
@RaghavPal 2 года назад
Most welcome
@flirtuall78
@flirtuall78 5 месяцев назад
Thank you for sharing another informative session.
@RaghavPal
@RaghavPal 5 месяцев назад
Most welcome
@ekaterinasobko7219
@ekaterinasobko7219 2 года назад
another great tutorial! thank u so much Raghav from Ukraine!
@RaghavPal
@RaghavPal 2 года назад
Most welcome Ekaterina
@ashafernandes6398
@ashafernandes6398 2 года назад
Much awaited. ♥️
@RaghavPal
@RaghavPal 2 года назад
Thanks for looking forward Asha, next video will come soon
@eicoz
@eicoz 2 года назад
Very useful tutorial, thanks !
@RaghavPal
@RaghavPal 2 года назад
Most welcome
@jannatulnayeem6858
@jannatulnayeem6858 2 года назад
Awesome tutorial
@RaghavPal
@RaghavPal 2 года назад
Thanks Jannat
@nadira9141
@nadira9141 2 года назад
Thanks a lot
@RaghavPal
@RaghavPal 2 года назад
Most welcome
@SudipRoysanosuke
@SudipRoysanosuke 2 года назад
Thanks a lot Raghav. I hope you'll also cover the Bidi api part. Looking forward to it.
@RaghavPal
@RaghavPal 2 года назад
I will try Sudip
@SudipRoysanosuke
@SudipRoysanosuke 2 года назад
@@RaghavPal Thanks 😊
@snehaldatir2419
@snehaldatir2419 2 года назад
Hope so start soon..👍
@RaghavPal
@RaghavPal 2 года назад
:)
@aurafaroff5917
@aurafaroff5917 Год назад
Good one Sir👏👏
@RaghavPal
@RaghavPal Год назад
Thanks
@nb3996
@nb3996 2 года назад
Thank you
@RaghavPal
@RaghavPal 2 года назад
Most welcome
@jayeshkumar2815
@jayeshkumar2815 2 года назад
Ragave sir can you make video on how we use JavaScript Executors along with Page Object Model. I tried lots of time but it not getting idea on it.
@RaghavPal
@RaghavPal 2 года назад
I will do Jayesh
@jayeshkumar2815
@jayeshkumar2815 2 года назад
Thank you ragav sir
@syedarmaghanhassan4652
@syedarmaghanhassan4652 10 месяцев назад
Hi Raghav, thanks a lot for teaching. Can we store it in a String? I mean the whole line of code: driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10)); I want to put it in a variable say waitPlease, so that when i wanna put wait, i don't have to right all the line, but i just write waitPlease; or can we make a function out of it? so that we can just write waitPlease(); and then we don*t have to write the whole line? is it possible?
@RaghavPal
@RaghavPal 10 месяцев назад
Syed Yes, you can store the whole line of code `driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));` in a String variable, or you can make a function out of it. **To store the wait code in a String variable:** ```java String waitPlease = "driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));"; ``` Then, you can use the `waitPlease` variable to wait for elements to be present on the page: ```java // Wait for the element with the ID "myElement" to be present on the page. WebElement element = driver.findElementById("myElement"); eval(waitPlease); element.click(); ``` **To make a function out of the wait code:** ```java public static void waitPlease() { driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10)); } ``` Then, you can call the `waitPlease()` function to wait for elements to be present on the page: ```java // Wait for the element with the ID "myElement" to be present on the page. WebElement element = driver.findElementById("myElement"); waitPlease(); element.click(); ``` **Which option should you use?** Both options are valid, but I recommend using the function option if you are going to be using the wait code multiple times in your test. This will make your code more readable and maintainable. Here are some additional tips for using waits in Selenium: * Use implicit waits sparingly. Implicit waits can slow down your tests, so it is best to only use them when necessary. * Use explicit waits to wait for specific conditions to be met. For example, you can use an explicit wait to wait for an element to be visible, clickable, or enabled. * Be careful not to overuse waits. Too many waits can make your tests slow and unreliable. I hope this helps
@arpitadash7598
@arpitadash7598 5 месяцев назад
what's are the changes in wait statement for selenium 4 and 3?
@RaghavPal
@RaghavPal 5 месяцев назад
Arpita In Selenium 4, there are changes in the wait statements compared to Selenium 3. Here's a summary: 1. Implicit Wait: - Selenium 3: ```java driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); ``` - Selenium 4 (deprecated): ```java driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10)); ``` 2. Explicit Wait (WebDriverWait): - Selenium 3: ```java WebDriverWait wait = new WebDriverWait(driver, 10); wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector(".classlocator"))); ``` - Selenium 4: ```java WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10)); wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector(".classlocator"))); ``` 3. Fluent Wait: - Selenium 3: ```java Wait wait = new FluentWait(driver) .withTimeout(30, TimeUnit.SECONDS) .pollingEvery(5, TimeUnit.SECONDS) .ignoring(NoSuchElementException.class); ``` - Selenium 4: ```java Wait fluentWait = new FluentWait(driver) .withTimeout(Duration.ofSeconds(30)) .pollingEvery(Duration.ofSeconds(5)) .ignoring(NoSuchElementException.class); ``` Remember to adapt your existing code to these changes when migrating to Selenium 4. ..
@arpitadash7598
@arpitadash7598 5 месяцев назад
@@RaghavPal thank you so much Sir
@ekoajiputra9431
@ekoajiputra9431 2 года назад
Hello Mr. Raghav, would you guide me. How to change http port tp https port for Jenkins?
@RaghavPal
@RaghavPal 2 года назад
Hi Eko, not sure on this
@ekoajiputra9431
@ekoajiputra9431 2 года назад
@@RaghavPal alright thx Mr raghav, because i have problem here
@RaghavPal
@RaghavPal 2 года назад
If I find something useful will share with you
@hariprasad7887
@hariprasad7887 2 года назад
Ragav. Is there anyway to convert .xlsb to .xlsx using Apache poi
@RaghavPal
@RaghavPal 2 года назад
Not sure Hari
@andrey-Green
@andrey-Green 2 года назад
don't mix explicit and implicit waits
@RaghavPal
@RaghavPal 2 года назад
Yes, or use them with the wait time calculated
Далее
Selenium 4 Beginner Tutorial 4 | Pop ups and Alerts
15:09
How to Become Genius in XPath in Selenium  - Session -18
39:48
07 Selenium - Ожидания
1:00:54
Просмотров 2,2 тыс.