question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

browser.driver vs browser. Which one to use?

See original GitHub issue

Can someone please explain in plain English (or point to docs) on when I should use browser.driver and when browser when calling methods? For example:

browser.get() or browser.driver.get()?
browser.getAllWindowHandles() or browser.driver.getAllWindowHandles()?
browser.getCurrentUrl() or browser.driver.getCurrentUrl()?

Thanks.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Reactions:2
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
MarkAPhillipscommented, Aug 20, 2015

Just to add to this - I find that browser.driver works better on AngularJS apps that take time to sync. I have tried both and for some reason browser.driver is more reliable.

I think more clarity needs to added in relation to this as why not just use browser.driver as it works on both Angular and non-Angular apps and therefore eliminates this confusion as to which one to use.

0reactions
demisxcommented, Mar 16, 2015

@ryancat Hi there. As far as I understood, browser.driver.x is for interaction with non-Angular pages and browser.x methods are wrappers for interacting with Angular pages.

Read more comments on GitHub >

github_iconTop Results From Across the Web

browser.get vs browser.driver.get - TIPS AND TRICKS
Protractor's Documentation recommends using wrapped driver directly instead of ... browser.driver.get, When the web page doesn't have Angular components ...
Read more >
node.js - Protractor : use browser or browser.driver methods?
The browser object is made up by composition of WebDriver methods and Protractor specific methods. So methods like sleep , wait , and ......
Read more >
What is Selenium WebDriver? Introduction ... - Intellipaat
Each web browser has its own browser driver, such as Chrome, Firefox, and Internet Explorer (or HTTP Server). Developers can use Selenium to...
Read more >
Why we write WebDriver driver = new ChromeDriver()
This driver instance has access to almost all the methods of WebDriver. This happens because every browser extends RemoteWebDriver and RemoteWebDriver ...
Read more >
Selenium RemoteWebDriver : Difference between WebDriver ...
When test cases are executed, the WebDriver client libraries link with the browser drivers directly. On the other hand, if one tries to ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found