Skip to main content
Bumped by Community user
formatting
Source Link
Bharat Mane
  • 6.8k
  • 11
  • 41
  • 69

If there is an id available for an object in a page, find element by ID or CSS - which is faster?

element(by.id("btnButtonID")) OR element(by.css("#btnButtonID")

element(by.id("btnButtonID")) OR element(by.css("#btnButtonID")

Since we can identify any objects using cssCSS locator, is it a standard practice to use only cssCSS locator in our page objects? Does it help to look the code readable and cleaner?

If there is an id available for an object in a page, find element by ID or CSS - which is faster?

element(by.id("btnButtonID")) OR element(by.css("#btnButtonID")

Since we can identify any objects using css locator, is it a standard practice to use only css locator in our page objects? Does it help to look the code readable and cleaner?

If there is an id available for an object in a page, find element by ID or CSS - which is faster?

element(by.id("btnButtonID")) OR element(by.css("#btnButtonID")

Since we can identify any objects using CSS locator, is it a standard practice to use only CSS locator in our page objects? Does it help to look the code readable and cleaner?

Source Link

locating element by id or css, which is faster?

If there is an id available for an object in a page, find element by ID or CSS - which is faster?

element(by.id("btnButtonID")) OR element(by.css("#btnButtonID")

Since we can identify any objects using css locator, is it a standard practice to use only css locator in our page objects? Does it help to look the code readable and cleaner?