gpt4 book ai didi

angularjs - 无法使用 Protractor 在 iframe 中找到文本字段

转载 作者:行者123 更新时间:2023-11-28 20:54:57 24 4
gpt4 key购买 nike

<iframe class="embedded-tax-form" scrolling="no" seamless="seamless" src="http://forms.tax-api-1w7xi0.addevcloudsites.myob.com/au-fbt-2015/1.0.0/?host=addevcloudsites.myob.com&amp;client=deb4bb44-994f-4ce7-aea8-6507925beb8a" 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">

我在 Iframe 中嵌入了文本字段,我正在使用 Protractor 并编写如下代码,作为最新的 Protractor ,我们不需要实例化实例:

it('should show the functioning input directive example', function () {
browser.get('http://qa5.addevcloudsites.myob.com/tax/edit/?client=4cccbc62-15b1-41e3-a9ed-0d93e7d05db2');
// 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);
});

当我运行它时,整个页面会刷新并显示

ReferenceError: iframe is not defined NoSuchFrameError: no such frame

我检查了元素是否存在,并在控制台上写入并使用了 elementory:

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

让我知道,我应该如何处理最新的 Protractor 。如果您需要这方面的更多信息,请告诉我。

最佳答案

browser.switchTo().frame('iFrameResizer1').由于这需要和 ID,而您正在提供类名!

希望这能奏效!

关于angularjs - 无法使用 Protractor 在 iframe 中找到文本字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28190081/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com