Can't we use RemoteWebDriver = new ChromeDriver()? Selenium Interview Q&A - 5 [Short Answer Series]

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ก.ย. 2021
  • In this video, I have explained why can't we use RemoteWebDriver = new ChromeDriver()?
    ~~~Subscribe to this channel, and press bell icon to get some interesting videos on Selenium and Automation:
    th-cam.com/users/Naveen%20Au...
    Follow me on my Facebook Page:
    / naveenqtpexpert
    Let's join our Automation community for some amazing knowledge sharing and group discussion on Telegram:
    t.me/joinchat/9FrG-KzGlvxjNmQ1
    Naveen AutomationLabs Paid Courses:
    Java & Selenium:
    naveenautomationlabs.com/manua...
    Java & API +POSTMAN + RestAssured + HttpClient:
    naveenautomationlabs.com/selen...
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 36

  • @madhuripatil8519
    @madhuripatil8519 ปีที่แล้ว

    I have gone through 3 to 4 videos on TH-cam but after watching your video i finally understand the concept.thank you!

  • @RAbode
    @RAbode 2 ปีที่แล้ว +6

    I know this because. . . It's secret. Thank you sir. U made easy everything with concept.

  • @testinginsights-muktasharma
    @testinginsights-muktasharma 2 ปีที่แล้ว +3

    Thank you Naveen!

  • @softwaretestinglearninghub
    @softwaretestinglearninghub ปีที่แล้ว +1

    Great coverage as always Naveen, thank you!

  • @Nandhis
    @Nandhis 2 ปีที่แล้ว +3

    Useful. thank you👍

  • @sumapatil6661
    @sumapatil6661 2 ปีที่แล้ว +2

    Hi Naveen, Very clear explanation.Hats off to you. Thanks a lot.

  • @sarswatiyaliwal481
    @sarswatiyaliwal481 2 ปีที่แล้ว +2

    Thank you so much Naveen:)

  • @sandeepkokane9549
    @sandeepkokane9549 2 ปีที่แล้ว +2

    Very nice explanation.Thanks Naveen 👍

  • @piyushmathpal4244
    @piyushmathpal4244 2 ปีที่แล้ว +8

    Support:
    1. Say, If RWD has additional methods (which are not present in WD Interface),
    then we are missing out those methods while writing WD dr= new CD();
    2. Other reason to not use the above line is we need not to typecast our driver to TakesScreenShot or JSExecutor.
    On Contrary:
    1. Interfaces are used to achieve loose coupling and pure abstraction.
    2. Additional methods in interfaces would support all the implementing subclasses.
    Devs, would always prefer changes in an interface rather than disturbing multiple implemented classes, thus reducing the redundancy and errors.

    • @Udzial
      @Udzial 2 ปีที่แล้ว

      Thanks @piyush , but i think first point is not right (under Support) as naveen explained from #02:40 to #02:52 , we can access the extra methods implemented by class

  • @leelajain9173
    @leelajain9173 2 ปีที่แล้ว +2

    Thanks Naveen :)

  • @RakeshSaineni
    @RakeshSaineni ปีที่แล้ว

    Loved your explanation

  • @srinivaspatel2567
    @srinivaspatel2567 28 วันที่ผ่านมา

    Thanks Naveen Sir

  • @servantOfKripalu
    @servantOfKripalu 2 ปีที่แล้ว +6

    Excellent video. This question had always been poking around in my mind... Thank you for clarifying this...

  • @AtulSingh-go9ug
    @AtulSingh-go9ug 2 ปีที่แล้ว

    Any idea on edge browser, I want to launch a specific site in ie11mode on edge browser but unable to get ie11 mode .please suggest

  • @pradeepprudhvi6017
    @pradeepprudhvi6017 2 ปีที่แล้ว

    Very nice explanation

  • @ujjalpanda7345
    @ujjalpanda7345 2 ปีที่แล้ว

    Hi sir, Can we change app language through Desired Capabilities by providing some code like - Device name, packageActivity? help me plz.

  • @gamyamentertainment4922
    @gamyamentertainment4922 ปีที่แล้ว

    Hey, hi '
    i'm doing one project in google cloud . data pulling into google cloud with help of python script using automation.
    for that we created script , inside that i was used chrome drivers , when i execute the code , the message error has been shown like ,(chrome driver executable need to be path) like that message it was shown. i was tried different web driver and remote web drivers created one docker file on that too. So, which code will work in google cloud editor. can you please give some hint ..it very helpfull to me .

  • @adityanarayan3325
    @adityanarayan3325 2 ปีที่แล้ว +2

    I don't get my answer, why we prefer upcast to WebDriver(I) always instead of RWD class ? please put some light on it @Naveen

  • @akshaygoyal1
    @akshaygoyal1 2 ปีที่แล้ว +3

    if i use this approach then 1 more benefit, no need to cast driver in JavascriptExecutor / TakesScreenshot
    Please correct me Naveen if I am wrong

    • @akshaygoyal1
      @akshaygoyal1 2 ปีที่แล้ว

      as RemoteWebdriver has all the interfaces

  • @nstefi
    @nstefi 2 ปีที่แล้ว +4

    I don't understand. The question is why can't we write "RemoteWebDriver driver = new ChromeDriver();", but that's exactly what you write at 4:12 in the video, so it's allowed. I am trying to write the same in C# and it gives me an error: "Cannot implicitly convert type 'OpenQA.Selenium.Chrome.ChromeDriver' to 'OpenQA.Selenium.Remote.RemoteWebDriver'"

    • @sailakshman3088
      @sailakshman3088 2 ปีที่แล้ว

      For that you have to check c# selenium api, in java selenium it is fine as the architecture supports it.

    • @nstefi
      @nstefi 2 ปีที่แล้ว +1

      ​@@sailakshman3088 OK, I see that he is coding in Java, but still the question was "Can't we use ...?", so the answer is "Yes, we can", right?
      In C# I used this way:
      OpenQA.Selenium.IWebDriver driver = new ChromeDriver();

  • @vinavmevada8419
    @vinavmevada8419 2 ปีที่แล้ว +8

    Great expectations. One observation is that for javascript executor and take screenshot interface is also part of hierarchy.
    If we use remotewendriver we don't need to add casting for java script executor and take screenshot interface because remote web driver hold property for javascript executor and take screenshot.
    But if we use Webdriver driver in this case we have to add casting for javascript executor and take screenshot because Webdriver interface does not hold property for javascript executor and take screenshot interface. 🙏

  • @joshibhushan1
    @joshibhushan1 2 ปีที่แล้ว

    We can use it because up casting is allowed in java

  • @user-nl6qo8cj3i
    @user-nl6qo8cj3i ปีที่แล้ว

    What will be best way to work elements inside canvas element?

  • @shafiyasunkesala3384
    @shafiyasunkesala3384 2 ปีที่แล้ว

    Hi can we write searchcontext driver = new chromedriver();?

    • @naveenautomationlabs
      @naveenautomationlabs  2 ปีที่แล้ว +1

      No you should not, you will get only FE and FEs from SearchContext.

    • @shafiyasunkesala3384
      @shafiyasunkesala3384 2 ปีที่แล้ว

      @@naveenautomationlabs thank you for quick reply. I got interview question asking can we write webdriver driver= new Remotewebdriver().
      My answer was to communicate with the browser we have to create instance of chrome or Firefox etc drivers.
      Pls let me know if we can add anything

    • @sp38860
      @sp38860 8 หลายเดือนก่อน

      ​@@shafiyasunkesala3384so can we write webdriver dr = new remotewebdriver()

  • @pankajborkar1072
    @pankajborkar1072 ปีที่แล้ว

    but what is difference why everyone using WebDriver driver = new ChromeDriver();

  • @omshankergoyal1695
    @omshankergoyal1695 2 ปีที่แล้ว

    Can we write RemoteWebdriver driver = new RemoteWebdriver(),

    • @dhanashreeize
      @dhanashreeize 4 หลายเดือนก่อน

      technically its right but we cant write it in our script because with this line we wont be able to lauch any browser(we write remotewebdriver driver=new chromedriver or webdriver driver=new cromedriver() for launching the browsers) and secondly remotewebdriver constructor is private so we cannot create object of remotewebdriver.hence we cant write remotewebdriver driver=new remotewebdriver() as its of no use.

  • @vinaymakkar3860
    @vinaymakkar3860 ปีที่แล้ว +1

    why do we prefer to upcast WebDriver() instead of RWD class ? Any particular reason? Kindly explain. @naveenautomationlabs