Closed Bug 865627 Opened 11 years ago Closed 11 years ago

Change exists method for handling Lookup expression that does not exist

Categories

(Testing Graveyard :: Mozmill, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 860659

People

(Reporter: daniela.p98911, Assigned: daniela.p98911)

References

Details

(Keywords: testcase)

Attachments

(2 files)

After investigating bug 864375, we have found out that exists method in mozelement does not handle the case where the lookup expression does not exist and an exception is thrown from elementslib.Lookup.

In Mozmill 1.5.21 we had this method: https://github.com/mozilla/mozmill/blob/hotfix-1.5/mozmill/mozmill/extension/resource/modules/elementslib.js#L417 that handled an element that did not exist.

In Mozmill 2.0 when trying to get the element https://github.com/mozilla/mozmill/blob/master/mozmill/mozmill/extension/resource/driver/mozelement.js#L126 (this.element from __defineGetter__ method) we are calling again elementslib.Lookup which will cause an exception since the element does not exist on the page.
Whiteboard: [mozmill-2.0?]
Attached patch patch v1.0Splinter Review
Modified exists in mozelement.js returns true if the this.element exists or false in case the element does not exist or an error is thrown when searching for the element.
Assignee: nobody → dpetrovici
Status: NEW → ASSIGNED
Attachment #741794 - Flags: review?(hskupin)
Attachment #741794 - Flags: review?(dave.hunt)
Depends on: 864375
Comment on attachment 741794 [details] [diff] [review]
patch v1.0

Review of attachment 741794 [details] [diff] [review]:
-----------------------------------------------------------------

Before we review this please make sure to add a proper test for this particular case.
Attachment #741794 - Flags: review?(hskupin)
Attachment #741794 - Flags: review?(dave.hunt)
I wanna see a testcase here given that I can't see how an exception can be raised by the element getter.
Keywords: testcase-wanted
So this is not something we should wallpaper in mozelement.js. The real problem lays in elementslib.js and has to be fixed in that file.
This is actually a dupe of bug 860659.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
Whiteboard: [mozmill-2.0?]
Product: Testing → Testing Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: