首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >实习生3在单击元素时出现奇怪的错误

实习生3在单击元素时出现奇怪的错误
EN

Stack Overflow用户
提问于 2017-12-19 22:53:55
回答 1查看 79关注 0票数 0

我已经面对过很多次了。我有一个代码设置,intern在input元素中输入特定的输入,然后单击submit按钮。但实习生在点击按钮时出现错误。我的代码设置如下:

代码语言:javascript
复制
   // other tests

"Load Client":function(){


        var self = this
        return inputs.Clients.reduce(function (chain, client) {
            isNA = false;
            return chain
                .then(viewClientPage.clickOnAddClientBtn())
                .then(addClientModal.clientName.enterValue(client.ClientName))
                .then(function () {
                    return client.LineOfBusiness.reduce(function (chain1, lob) {
                        return chain1
                            .then(addClientModal.stateLOB.selectOption(lob.LOBName))
                            .then(addClientModal.state.clearValue())
                            .then(function () {
                                return lob.States.reduce(function (chain2, state) {
                                    if (state.StateName == 'N/A') {
                                        isNA = true;
                                        return chain2
                                            .then(addClientModal.selectAllStateCheckBox())
                                    } else {
                                        return chain2
                                            .then(addClientModal.state.enterValue(state.StateName))
                                    }
                                }, self.remote);
                            })
                            .then(addClientModal.clickOnAddStateBtn())



                    }, self.remote);
                })
                .sleep(6000)
                .findByXpath('//*[@id="saveModal"]').click().end() // this is raising error
        }, this.remote)

 }

我得到的错误是

代码语言:javascript
复制
          UnknownError: [POST http://localhost:4444/wd/hub/session/737b17818334be969beb0ce6a8174f12/element/0.48698099328565236-11/click] unknown error: Element <button type="button" class="btn btn-primary save" style="float:right" ng-click="addNewPayer('Payers','clients/clients/partials/addNewPayerModal.tpl.html','...',client,editParameters)">Add Client</button> is not clickable at point (1296, 112). Other element would receive the click: <div tabindex="-1" role="dialog" class="modal fade ng-isolate-scope custommodal-modal-edit in" ng-class="{in: animate}" ng-style="{'z-index': 1050 + index*10, display: 'block'}" ng-click="close($event)" modal-window="" window-class="custommodal-modal-edit" size="lg" index="0" animate="animate" style="z-index: 1050; display: block;">...</div>
   (Session info: chrome=63.0.3239.84)
   (Driver info: chromedriver=2.34.522940 
    (1a76f96f66e3ca7b8e57d503b4dd3bccfba87af1),platform=Windows NT 6.1.7601 SP1 
      x86_64)
     at runRequest  <node_modules\leadfoot\Session.js:92:40>
     at <node_modules\leadfoot\Session.js:113:39>
     at new Promise  <node_modules\dojo\Promise.ts:411:3>
     at ProxiedSession._post  <node_modules\leadfoot\Session.js:67:10>
     at Element._post  <node_modules\leadfoot\Element.js:23:31>
     at Element.click  <node_modules\leadfoot\Element.js:197:15>
     at Command.<anonymous>  <node_modules\leadfoot\Command.js:680:19>
     at <node_modules\dojo\Promise.ts:393:15>
     at run  <node_modules\dojo\Promise.ts:237:7>
     at <node_modules\dojo\nextTick.ts:44:3>
     at Command.target.(anonymous function) [as click]  
    <node_modules\leadfoot\Command.js:674:11>
    at Command.<anonymous>  



<Automation\pageObjects\pages\clientSetup\clients\viewClientsPage\ViewClientPage.js:61:71>
         at runCallback  <node_modules\leadfoot\Command.js:526:31>
          at Command.<anonymous>  <node_modules\leadfoot\Command.js:543:11>
          at <node_modules\dojo\Promise.ts:393:15>
         at run  <node_modules\dojo\Promise.ts:237:7>
         at <node_modules\dojo\nextTick.ts:44:3>
         at _combinedTickCallback  <internal\process\next_tick.js:67:7>
         at process._tickCallback  <internal\process\next_tick.js:98:9>
         at Command.then  <node_modules\leadfoot\Command.js:542:10>
         at <Automation\Data_Load\LoadSM2Data.js:61:30>
         at Array.reduce  <native>
          at Test.Load Clients [as test]  <Automation\Data_Load\LoadSM2Data.js:56:35>
  at <node_modules\intern\lib\Test.js:191:24>
  at <node_modules\intern\browser_modules\dojo\Promise.ts:393:15>
  at runCallbacks  <node_modules\intern\browser_modules\dojo\Promise.ts:11:11>
  at <node_modules\intern\browser_modules\dojo\Promise.ts:317:4>
  at run  <node_modules\intern\browser_modules\dojo\Promise.ts:237:7>
  at <node_modules\intern\browser_modules\dojo\nextTick.ts:44:3>

我曾尝试更改seenium-server-standalone.jar chromedriver.exe的版本,甚至尝试使用findByXpathfindById等,但都不起作用。请帮帮我

谢谢。

EN

回答 1

Stack Overflow用户

发布于 2017-12-20 00:16:58

该错误指示标签为"Add Client“的按钮不可单击,因为模式对话框将接收单击。首先,这真的是应该点击的按钮吗?如果不是,则需要改进提供给findBy的搜索词。

假设这是正确的按钮,当单击操作发生时,它是否被模式对话框遮挡?如果是,请采取措施确保对话框已关闭。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/47889593

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档