Protractor cannot seem to find <object> tag references in the page
Some of our tests require testing for the presence of flash objects loaded into the DOM. Though we can see these and also verify that document.getElementById('foo') finds them, protractor does not seem to be able to locate them using protractor.By.id() or protractor.By.name().
What are the magic words necessary to do this?
@agscheidle does it look like this is the cause of your error: https://code.google.com/p/selenium/issues/detail?id=4647?
Perhaps, however it would seem to me that the itself would be on the DOM for the page. If that were the case, wouldn't I be able to locate and evaluate the instance?
Thanks, Andrew
On Sep 27, 2013, at 2:25 PM, Julie Ralph [email protected] wrote:
@agscheidle does it look like this is the cause of your error: https://code.google.com/p/selenium/issues/detail?id=4647?
— Reply to this email directly or view it on GitHub.
That does seem fishy. Can you copy the error text you get?
Usually something like:
"Cannot call method [examples: isDisplayed(), toBe(), etc] on undefined."
The root seems to be that the object reference is never defined despite trying it with;
ex object is:
Trying to reference it with:
ptor.findElement(protractor.By.id('testObject')) or ptor.findElement(protractor.By.name('testObject'))
Neither seem to provide a working reference (and are therefore undefined).
Thanks, Andrew
On Sep 27, 2013, at 4:30 PM, Julie Ralph [email protected] wrote:
That does seem fishy. Can you copy the error text you get?
— Reply to this email directly or view it on GitHub.
I also often get: TypeError: Object #
Andrew
On Sep 27, 2013, at 4:30 PM, Julie Ralph [email protected] wrote:
That does seem fishy. Can you copy the error text you get?
— Reply to this email directly or view it on GitHub.
That's odd - usually if webdriver can't find an element, it will error out, not return undefined. Let me try it out...
Can you copy the actual lines in your test? I tried finding an object and it works just fine. To the test application I added:
<object id="objecttag" type="image/svg+xml" data="image.svg">
Your browser does not support SVG
</object>
and then to the test I added the spec
it('should find object tag elements', function() {
var o = ptor.findElement(protractor.By.id('objecttag'));
expect(o.isDisplayed()).toBe(true);
});
Everything passes just fine.
Closing this, please reopen if you're still having issues.