mercredi 28 janvier 2015

Not able to locate the text field inside the iframe using protractor


<iframe class="embedded-tax-form" scrolling="no" seamless="seamless" src="http://ift.tt/15Td7KY" id="iFrameResizer1" style="overflow: hidden; height: 3971px;"></iframe>
<input id="input.ReportingParty.Identifiers.TaxFileNumber.Identifier" type="text" ng-model="form.fields['ReportingParty.Identifiers.TaxFileNumber.Identifier'].value" ng-change="run()" class="form-control ng-pristine ng-valid ng-touched" ng-readonly="form.fields['ReportingParty.Identifiers.TaxFileNumber.Identifier'].source === 'calculation'" source-selection="ReportingParty.Identifiers.TaxFileNumber.Identifier">


I have text field embedded inside the Iframe and I'm using the Protractor and written the code as below, as the latest protract we need not have to instantiate the instance:



it('should show the functioning input directive example', function () {
browser.get('http://ift.tt/1uAKIir');
// Ensure that the page is loaded before trying to switch frames.
browser.waitForAngular();
browser.switchTo().frame('embedded-tax-form');
var nameInput = element(by.model("form.fields['ReportingParty.Identifiers.TaxFileNumber.Identifier'].value"));
nameInput.sendKeys('222);
});


when I run this, complete page gets refreshed and says



ReferenceError: iframe is not defined NoSuchFrameError: no such frame



I checked whether element is present writing on console and used elementory:



elementArrayFinder_: { getWebElements: [Function],
actionResults_: undefined,
locator_: { using: 'css selector', value: '.embedded-tax-form' },
click: [Function],


Let me know, how I should handle in protractor latest. Please let me know if you need any more information on this.


Aucun commentaire:

Enregistrer un commentaire