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

Поділитися
Вставка
  • Опубліковано 1 січ 2025

КОМЕНТАРІ • 121

  • @HYRTutorials
    @HYRTutorials  4 роки тому +4

    📌 Selenium Interview Questions Playlist Link: bit.ly/3matUB3
    ✴ Checkout my other playlists: bit.ly/3gLIAVL
    ☕ Buy me a coffee: bit.ly/33ljBWc

  • @sirisha234
    @sirisha234 3 роки тому +8

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

    • @HYRTutorials
      @HYRTutorials  3 роки тому +2

      Thankyou 😊
      Diagram makes the topic easy and more understandable.

  • @rahulsony2272
    @rahulsony2272 Місяць тому

    Best explanation received so far .. Thanks Buddy

  • @ferdanondrej
    @ferdanondrej Рік тому

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

  • @gpavankumar175
    @gpavankumar175 3 роки тому +1

    Superb explaination. I was wondering why we are typecasting and what is it.
    Thanks, now clear.

  • @chithrarajeswaran730
    @chithrarajeswaran730 2 роки тому +1

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

  • @Suukhhh
    @Suukhhh 2 роки тому

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

  • @AnkitSingh-be4wi
    @AnkitSingh-be4wi 4 роки тому +2

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

  • @adityakavathale58
    @adityakavathale58 2 роки тому +1

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

  • @rupalibhagat1989
    @rupalibhagat1989 Рік тому +1

    Excellent way of teaching......

  • @SongsSaregama
    @SongsSaregama 2 роки тому +1

    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.

  • @anichavan11
    @anichavan11 3 роки тому +1

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

  • @swayamkarnjkar6516
    @swayamkarnjkar6516 3 роки тому +1

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

  • @hiteshdarji9925
    @hiteshdarji9925 2 роки тому +1

    Nice. Very good explanation.

  • @umadevi-yo3yl
    @umadevi-yo3yl 3 роки тому +1

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

  • @C.Sakthivignesh
    @C.Sakthivignesh Рік тому +2

    Thanks sir for made this video.

  • @PradipYogi59
    @PradipYogi59 3 роки тому +1

    Very good explanation

  • @veganforlife4699
    @veganforlife4699 Рік тому

    Best explanation, thanks mate. Gratitude 🙏🙏🙏

  • @sathishvijay3476
    @sathishvijay3476 2 роки тому

    Very clear explanation

  • @guruishu7766
    @guruishu7766 4 роки тому +1

    Perfect explanation as usual

    • @HYRTutorials
      @HYRTutorials  4 роки тому +1

      Thank you 😊 Stay tuned for more videos like this

  • @pasha9327
    @pasha9327 4 роки тому +1

    Great Explanation.thank you so much.

  • @jagsautomation2759
    @jagsautomation2759 Рік тому

    Excellent explanation.

  • @zeeshanahmed9943
    @zeeshanahmed9943 3 роки тому +1

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

  • @Bala786A
    @Bala786A 3 роки тому +1

    Good explained..... Thank you 👍

  • @paresh-ranaut
    @paresh-ranaut 2 роки тому

    Great explanation, Thank you very much!

  • @akshaysagare5378
    @akshaysagare5378 4 роки тому +1

    Very nice explaination

  • @GowthamiNaraparaju-h6s
    @GowthamiNaraparaju-h6s Рік тому +1

    simply super bro

  • @hemangishelake4379
    @hemangishelake4379 4 роки тому +1

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

  • @owel09
    @owel09 3 роки тому +1

    thank you. You explain it very well

  • @arreddypala5058
    @arreddypala5058 2 роки тому

    Super explanation

  • @pramothcr1503
    @pramothcr1503 Рік тому +1

    wow simply awesome !

  • @yuvasrivanth
    @yuvasrivanth 3 роки тому +1

    Excellent one 🙏

  • @harinihar2468
    @harinihar2468 3 роки тому +1

    Neat explanation 👌👏..thank you subscribed 👍

  • @yaswanthtirupathi6551
    @yaswanthtirupathi6551 2 роки тому +1

    Thank you so much bro

  • @parvinkouliev11
    @parvinkouliev11 3 роки тому +3

    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.

    • @HYRTutorials
      @HYRTutorials  3 роки тому +3

      Yes we can use remotewebbriver class as well.
      There is nothing wrong in using it but the only reason we usually use the webdriver is because of its name.
      Remotewebbriver is more often used for remote execution where you mention the ip address and port number.
      So for all local executions we use webdriver.
      It's just a standard we usually follow but if we want to maintain the uniformity then we can always use the remotewebbriver class.

    • @youshouldknow9369
      @youshouldknow9369 3 роки тому

      Till Selenium v3, ChromeDriver extends RemoteDriver. This ChromeDriver was a WebDriver implementation that controlled the google-chrome browser running on the local machine.

    • @manikandankm3974
      @manikandankm3974 2 роки тому

      @@HYRTutorials Hello Sir , I have a doubt here , Even we use Webdriver instance here , Remotewebdriver Inherits its properties and Again All the browser class INHERITS the properties of Remowebdriver ( Chromedriver Extends RemoteWebdriver) , In this case we don't requires typecasting right , The browser classes have all the method implementation of JS Interface and driver automatically takes the Methods of JS ?? Please clarify.

  • @RAHULKUMAR-rb6pl
    @RAHULKUMAR-rb6pl 8 місяців тому

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

  • @ferozkhanr6653
    @ferozkhanr6653 Рік тому +1

    Can we declare like RemoteWebDriver driver = new chromeDriver();

    • @HYRTutorials
      @HYRTutorials  Рік тому

      Yes we can declare buddy. When working with remote execution that's how we do it

    • @ferozkhanr6653
      @ferozkhanr6653 Рік тому

      @@HYRTutorials How to handle captcha in selenium, any third party lib is supported ?

    • @HYRTutorials
      @HYRTutorials  Рік тому

      @@ferozkhanr6653 No we cant handle the capta in selenium buddy. If your application has that feature then you can ask the dev to provide some property for the capta control or you can ask them to turnoff that in the test enevs

  • @chinnikrishnad6736
    @chinnikrishnad6736 9 місяців тому

    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.

  • @MyGreatAchievers
    @MyGreatAchievers Рік тому

    when there is no relashion between webdriver and takescreenshort references then how can we typecasting it? please explain.

  • @kumarshubham5537
    @kumarshubham5537 5 місяців тому

    Can you please tell me how to say these answers precisely in interview as we won't have any script over there.

  • @adityatripathi3379
    @adityatripathi3379 2 роки тому +1

    Why we don't write RemoteWebDriver driver = new ChromeDriver(); ?

    • @HYRTutorials
      @HYRTutorials  2 роки тому

      We can write and there is nothing wrong in that.
      It's just that by name we can see.
      Remotewebdriver is mostly used for remote connections.

  • @Sowmya598
    @Sowmya598 4 роки тому +1

    Sir.. every one uses if else condition to choose d browser.. but u have used switch is der any reason behind dat.. thanks in advance

    • @HYRTutorials
      @HYRTutorials  4 роки тому +1

      In if else condition everytime u r checking minimum 1 condition and if that condition fails then again it will go for another condition.
      Like that it continues condition checking.
      So to avoid that we have to use switch condition.

    • @Sowmya598
      @Sowmya598 4 роки тому +1

      Thanks for d reply..😊 so in case of switch condition it directly jumps to d case on which we want to run our testscripts without​ checking each n every case

    • @HYRTutorials
      @HYRTutorials  4 роки тому

      Exactly.

  • @raghavendrasaicharan3188
    @raghavendrasaicharan3188 4 роки тому +1

    What is difference between extends and implements.

    • @HYRTutorials
      @HYRTutorials  4 роки тому +1

      Implements and extends are keywords.
      Implements is used when you want implement the unimplemented methods from interfaces.
      Extends is used when you want to inherit other class properties like attributes and methods.
      So it is mostly used in inheritance concepts.

  • @madhukrishna5704
    @madhukrishna5704 Рік тому

    As per the typecasting rule: The object(TakesScreenshot) type should be same or parent of runtime object of driver,i.e(Cromedriver).
    1)It works when both are related to class.
    2)But i don't know when they are interfaces and classes.(TakesScreenshot is a interface and Chromedriver is a class).
    Is same typecasting rule applied to above statements? If not could pls clarify my doubt?

  • @ManiKandan-vo2qr
    @ManiKandan-vo2qr 4 роки тому +2

    Hello Sir , JavaScript Executor is also an interface right? So Even though we type cast into JavaScript executor , How can we access the method executescript() which is un-Implemented still in interface ? Please tell me

    • @HYRTutorials
      @HYRTutorials  4 роки тому

      Basically here we alrdy have the fully implemented driver but when u r creating the driver instance type as webdriver then you can only access methods inside the webdriver interface even though it has the JavaScriptExecutor methods code.
      So that is why we are typecasting it to JavaScriptExecutor.

    • @Drake9w1
      @Drake9w1 3 роки тому

      @@HYRTutorials Hello Sir. I had the same question and I did not understand this answer. Could you please simplify.

    • @HYRTutorials
      @HYRTutorials  3 роки тому

      @@Drake9w1 to understand this, have some basic understanding of interfaces and classes.
      It's very easy once you got some basic idea about those.

    • @swapnabhaskaruni
      @swapnabhaskaruni 2 роки тому

      @@HYRTutorials so do you mean because we write a statement WebDriver driver = new ChromeDriver() and the ChromeDriver class has all the methods implemented from WebDriver, JavaScriptExecutor and TakesScreenshot we are able to typecast the driver and access other interface class methods.
      But if we write WebDriver driver = new WebDriver() then the typecast would not work. Please correct me.

    • @HYRTutorials
      @HYRTutorials  2 роки тому

      @@swapnabhaskaruni first of all you can't create an object for webdriver.
      Check your second statement one more time

  • @subhashinic7000
    @subhashinic7000 Рік тому +1

    Why are we not typecasting it when we use ChromeDriver driver; ?

    • @HYRTutorials
      @HYRTutorials  Рік тому

      Because typecasting is not required buddy

  • @swapnabhaskaruni
    @swapnabhaskaruni 2 роки тому +1

    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.

    • @HYRTutorials
      @HYRTutorials  2 роки тому +1

      Some of the additional topics are covered in English and the interview questions are also created in English only.
      I will create them in telugu language but it may take some time

  • @sujitblues
    @sujitblues 8 місяців тому

    please create java interview series (coding & conceptual ) both

  • @ksdnsdkumar1375
    @ksdnsdkumar1375 2 роки тому +1

    You didn't mention "RemoteWebDriver" anywhere, then why did you include in the diagram?

    • @HYRTutorials
      @HYRTutorials  2 роки тому

      Remotewebdriver is the class where all the interferences are implemented buddy

  • @harisake6068
    @harisake6068 Рік тому

    Thank you

  • @abinashprakash804
    @abinashprakash804 2 роки тому +1

    awesome

  • @mjj3tube
    @mjj3tube 2 роки тому +1

    When we say Takescreenshot ts = (Takescreenshot ) driver , is this up casting or down casting ?

    • @HYRTutorials
      @HYRTutorials  2 роки тому +1

      you could say upcasting only but we shouldn't use the down casting or upcasting words here instead we should simply call it as typecasting.

    • @mjj3tube
      @mjj3tube 2 роки тому +1

      @@HYRTutorials got it thanks for the kind response

  • @rishabhmehta9498
    @rishabhmehta9498 Рік тому +1

    Thankyou

  • @babupemmada1580
    @babupemmada1580 2 роки тому +1

    What is unimplemented methods sir?

    • @HYRTutorials
      @HYRTutorials  2 роки тому

      In java we have the concept of abstract methods and non abstract methods.
      Abstract methods are also called as unimplemented methods.
      These methods are present in either interface it abstract class.

  • @alaharimeenasri7168
    @alaharimeenasri7168 3 роки тому +1

    please do more viodes on inetrview questions bro , whenever you are free...

    • @HYRTutorials
      @HYRTutorials  3 роки тому

      Yeah sure, currently I'm not getting much time in this month.
      Will make those videos in next month for sure

    • @alaharimeenasri7168
      @alaharimeenasri7168 3 роки тому +1

      Ok bro thanks ☺️☺️..

  • @mycreativelife2837
    @mycreativelife2837 Рік тому +1

    👏👏👏👏👏

  • @chayae3740
    @chayae3740 3 роки тому +1

    Tqu

  • @116sivaramakrishnasai2
    @116sivaramakrishnasai2 2 роки тому

    Why don't we use RemoteWebDriver?

    • @HYRTutorials
      @HYRTutorials  2 роки тому

      We can use without any problem buddy.
      But it's just the naming convention.
      Remotewebdriver is mostly used for remote connections

  • @rahulyadav-cl2rd
    @rahulyadav-cl2rd Рік тому

  • @ksdnsdkumar1375
    @ksdnsdkumar1375 2 роки тому +1

    @10:00 Thank me later.

  • @mohanramakrishnakonijety9405
    @mohanramakrishnakonijety9405 5 місяців тому

    Thank you