Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New element #27

Merged
merged 6 commits into from
Jun 7, 2012
Merged

New element #27

merged 6 commits into from
Jun 7, 2012

Conversation

OniOni
Copy link
Contributor

@OniOni OniOni commented Jun 6, 2012

In other Webdriver implementations, it is possible to call methods such as click on returned elements. This is now possible with the element object. Old methods that work on the browser object still work.

So you can choose between :

browser.element(locatorBy, locator, function (err, el) {
   el.click(function() { ... });
}

And :

browser.element(locatorBy, locator, function (err, el) {
   browser.clickElement(el, function() { ... });
}

This is implemented for :

  • sendKeys
  • click
  • text
  • textPresent
  • getAttribute
  • getValue
  • clear

Problem

I had to rewrite two test cases for the tests to pass with the new element object.
Equality tests fail between two elements that have same properties and strict equality for all these properties.

In other Webdriver implementations, it is possible to call methods such as click on returned elements. This is now possible with the element object. Old methods that work on the browser object still work.

So you can choose between :

browser.element(locatorBy, locator, function (err, el) {
   el.click(function() { ... });
}

And :

browser.element(locatorBy, locator, function (err, el) {
   browser.clickElement(el, function() { ... });
}

This is implemented for :
- sendKeys
- click
- text
- textPresent
- getAttribute
- getValue
- clear
This sounds weird, one should ot have to update the unit test so that new code works. This goes against the principle of regression testing. However, for some reason equality test fail on objects even thought they share all properties and that all properties are strictly equal. There must be a better way to go about this.
admc added a commit that referenced this pull request Jun 7, 2012
@admc admc merged commit 5cb869e into admc:master Jun 7, 2012
@alindsay55661
Copy link

This is great, any chance we can get this for the methods that return multiple elements? Right now all I get back is an object with a value property. Not sure what to do with this.

@sebv
Copy link
Collaborator

sebv commented Apr 25, 2013

Could you open separate issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants