0

I have seen two ways of defining functions/objects when reviewing javascript in Protractor:

One looks like this:

name1: { get: function() { return element.all(by.css('.mything')); }},

Another looks like this:

name2: { value: function() { return element.all(by.css('.files')); }}

Can someone please explain what the difference is between the use of VALUE vs GET with defining Page Objects?

nilsK
  • 4,323
  • 2
  • 26
  • 40
Serious
  • 153
  • 11
  • it's just the functions name, i wouldn't bother. maybe programmers with Java background prever `get` and others prever `value` ... who knows ;o – nilsK Sep 02 '14 at 15:57
  • This looks like an Astrolabe question. Personally I don't wrap ElementFinders in functions since is [not necessary](https://github.com/angular/protractor/blob/master/docs/page-objects.md#with-pageobjects) – Leo Gallucci Sep 02 '14 at 17:28
  • Here is a great article explaining the differences. http://www.htmlgoodies.com/beyond/javascript/object.create-the-new-way-to-create-objects-in-javascript.html – Serious Sep 03 '14 at 01:23

0 Answers0