Why do we need to typecast the WebDriver Instance to use TakeScreenshot or JavascriptExecutor?

preview_player
Показать описание
In this video, I have explained about "Why do we need to typecast the WebDriver instance to use TakeScreenshot or JavascriptExecutor Interface methods".

WebDriver is an interface with a set of unimplemented methods.

WebDriver drives a browser natively, as a user would, either locally or on a remote machine using the Selenium server, marks a leap forward in terms of browser automation.

Selenium WebDriver refers to both the language bindings and the implementations of the individual browser controlling code. This is commonly referred to as just WebDriver.

Selenium WebDriver is a W3C Recommendation

- WebDriver is designed as a simple and more concise programming interface.

- WebDriver is a compact object-oriented API.

- It drives the browser effectively.

When working with selenium, we typecast the webdriver instance in order to use the methods from TakeScreenshot or JavascriptExecutor interfaces.

So basically java doesn't allow us to create the interface objects, so that is the reason we always typecast the webdriver instance.

But do you know what exactly what happens when you typecast it and why we need to typecast it?

Watch this video to learn more about typecasting of webdriver instance.

==============================================

👑 Join my YouTube channel to get access to perks:👇

==============================================
==============================================
Connect us @
==============================================
==============================================
🙏 Please Subscribe🔔 to start learning for FREE now, Also help your friends in learning the best by suggesting this channel.

#hyrtutorials #selenium #interviewQuestions #webAutomation
Selenium Interview Questions By Yadagiri Reddy
h y r tutorials hyr tutorials selenium interview questions and answers selenium tutorial for beginners selenium java selenium interview questions and answers selenium tutorial for beginners selenium java
selenium selenium java selenium tutorial for beginners automation testing selenium webdriver
Рекомендации по теме
Комментарии
Автор

Just wow. What a nice way of explanation. That particular diagram is a million dollar worth.

sirisha
Автор

Great explanation of all important topics related to instantiation of WebDriver and typecasting I could find in one video, thank you!

ferdanondrej
Автор

Very good explanation and after watching full video came to know the main reason for typecasting. Please make more videos like this. 👍

anichavan
Автор

One of the very best explanation, I have ever came across you are awesome. you should make more videos on interview questions

swayamkarnjkar
Автор

Nice explaination using interface and inheritance all together 👍
Watched twice to recollect everything together..

AnkitSingh-bewi
Автор

Superb explaination. I was wondering why we are typecasting and what is it.

Thanks, now clear.

gpavankumar
Автор

one of the very good video and topic on the internet and the explanation way is very simple and good. this was one of the question in my mind from a long time, today i thought lets check on youtube and i found you. Thanks you sir for explaning this in very excellet way . Thanks a lot.

tejpatel
Автор

Best explanation, thanks mate. Gratitude 🙏🙏🙏

veganforlife
Автор

Thanks for the explanation sir. That diagram helps a lot.

adityakavathale
Автор

perfect explanation.. very easy to understand.. thanks much bro

chithrarajeswaran
Автор

Well explained 🙏🙏non technical people also can understand easily thank you so much 👏👏

umadevi-yoyl
Автор

Great explanation, Thank you very much!

paresh
Автор

Wow😍. What a explanation. Could you please make more videos on interview questions

hemangishelake
Автор

You are brilliant... Really Really Helpfull... Thank you sir

Suukhhh
Автор

Neat explanation 👌👏..thank you subscribed 👍

harinihar
Автор

Very good explanation...you are awesome...:)

zeeshanahmed
Автор

Excellent explanation. Can you also explain why don't we just use RemoteWebDriver class to create driver instance in this case which would not need typecasting since RemoteWebDriver inherits all methods of all 3 interfaces.

parvinkouliev
Автор

Wonderful HYR garu.
Then, can we directly do as following?
RemoteWebDriver driver=new RemoteWebDriver();

and use it?
Kindly reply. And, as always, Thanks for your great teaching.

chinnikrishnad
Автор

Looks like there are more selenium tutorials in english playlist than the selenium telugu playlist. If there are any missed topics in telugu playlist can you do them in telugu too. Its just easy to process in telugu. and i feel because our mother tongue is telugu explanation and understanding is easier and faster in telugu.

Please consider my request.

swapnabhaskaruni
Автор

Sir whenever we said typecasting for javascriptExecutor in that situation to be more precise we can say it is also upcasting or not

RAHULKUMAR-rbpl