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

preview_player
Показать описание
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:

Follow me on my Facebook Page:

Let's join our Automation community for some amazing knowledge sharing and group discussion on Telegram:

Naveen AutomationLabs Paid Courses:
Java & Selenium:

Java & API +POSTMAN + RestAssured + HttpClient:
Рекомендации по теме
Комментарии
Автор

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

RAbode
Автор

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

madhuripatil
Автор

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.

piyushmathpal
Автор

Great coverage as always Naveen, thank you!

softwaretestinglearninghub
Автор

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

TheUncutLearner
Автор

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

adityanarayan
Автор

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 to

nstefi
Автор

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

sumapatil
Автор

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

akshaygoyal
Автор

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. 🙏

vinavmevada
Автор

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 .

gamyamentertainment
Автор

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

AtulSingh-goug
Автор

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

ujjalpanda
Автор

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

vinaymakkar
Автор

What will be best way to work elements inside canvas element?
<canvas id="canvas" width="668" height="683" style="width: 535px; height: 547px;"></canvas>

SandeepNagpal-rr
Автор

We can use it because up casting is allowed in java

joshibhushan
Автор

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

pankajborkar
Автор

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

shafiyasunkesala
Автор

Can we write RemoteWebdriver driver = new RemoteWebdriver(),

omshankergoyal