Does it support ‘wait_for_page_load’ feature
Sure! It’s not native as part of the library, but you can write include your own: https://github.com/gempesaw/Selenium-Remote-Driver/wiki/Example-Snippets#wait-for-page-to-load . Note that the best practice in this situation is to actually put what you're waiting for as the body of the wait_until. For example, if you’re waiting to click on an element, wait_until the element exists via find_element instead of waiting for the page to load.
This means you won't wait any longer than necessary, and has the additional benefit of more accurately mimicking user interaction (a person using a website doesn't know or even care if the page is loaded - they just care if they can click/type/do whatever they wish to do).
Does it support assert verification, where when condition does not match , it should return and continue execution instead of exit.
Yes, you can handle this yourself in a few ways. Selenium::Remote::Driver on its own doesn’t do asserts or verification at all - it’s completely separate from a test library like Test::Spec or Test::More. So, you could pull in your test library of choice, and assert/verify away!
You can also look into Test::Selenium::Remote::Driver, which does do asserts and verification - but again, here, failing a test doesn’t end or exit the script.
A common gotcha is if your Driver execution ends up throwing an exception (like when failing to find an element, or incorrectly interacting with an alert, &c), the S::R::D code will die, which you will be responsible for wrapping in an appropriate eval or try/catch, etc. If your test encounters an exception and it’s not wrapped, then the Perl program itself will die, and S::R::D will clean up itself, which includes closing the browser and quitting the session on the webdriver server.
Thanks!
Hi Sir,
Thanks for the nice job. Questions:
1. Does it support ‘wait_for_page_load’ feature
2. Does it support assert verification, where when condition does not match , it should return and continue execution instead of exit.
If you know any other work around for this , plz help.
Thanks,
Pradeep.