1

After working with Eclipse/JUnit/webdriver for few months, and now, trying to come up to speed with Protractor, I am forced to fall back and submit some basic questions for you java/js experts.

  1. Why in Protractor, do I have to invoke direct reference of "browser.driver." when testing Non-Angular web pages versus in Eclipse/Junit/weddriver I just instantiate the webdriver object?

  2. In Protractor, when referencing the "browser.driver" directly, do I always have to use the element finder method "browser.driver.findElement"(by." or is the method overloaded such that "browser.driver.element(By." will also work?

alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
ColtsFan
  • 13
  • 4

1 Answers1

1

You don't need to use browser.driver directly.

The only common and important difference between testing an angular site and a non-angular one is browser.ignoreSynchronization boolean flag.

Aside from that, continue using global browser object and element notation. For example:

browser.ignoreSynchronization = true;
browser.get("http://mysite")

element(by.css("div.footer a#contactus")).click(); 

See also:

Community
  • 1
  • 1
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195