无法找到元素,这是在salesforce闪电中删除对象
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了无法找到元素,这是在salesforce闪电中删除对象相关的知识,希望对你有一定的参考价值。
<div class="DESKTOP uiModal forceModal open active" data-aura-rendered-by="3706:0" data-aura-class="uiModal forceModal" aria-hidden="false" style="z-index: 1;"><div class="modal-glass slds-backdrop fadein slds-backdrop--open" tabindex="-1" data-aura-rendered-by="3707:0" style="opacity: 1;"></div><div class="panel slds-modal slds-fade-in-open" aria-labelledby="title_3694:0" tabindex="-1" role="dialog" aria-modal="true" data-aura-rendered-by="3708:0"><div class="modal-container slds-modal__container" data-aura-rendered-by="3709:0"><div class="modal-header slds-modal__header empty slds-modal__header--empty" data-aura-rendered-by="3710:0"><!--render facet: 3711:0--><!--render facet: 3712:0--><!--render facet: 3713:0--><button class="slds-button slds-modal__close closeIcon slds-button_icon-bare slds-button_icon-inverse" type="button" title="Close this window" data-aura-rendered-by="3698:0"><lightning-primitive-icon data-aura-rendered-by="3699:0" lightning-primitive-icon_primitive-icon=""><svg focusable="false" data-key="close" aria-hidden="true" class="slds-button__icon slds-button__icon_large slds-button_icon-inverse" lightning-primitive-icon_primitive-icon="">
<use xlink:href="/_slds/icons/utility-sprite/svg/symbols.svg?cache=9.8.0#close" lightning-primitive-icon_primitive-icon=""></use>
</svg></lightning-primitive-icon><span class="slds-assistive-text" data-aura-rendered-by="3701:0">Close this window</span></button></div><div class="modal-body scrollable slds-modal__content slds-p-around--medium" data-aura-rendered-by="3716:0" data-scoped-scroll="true"><!--render facet: 3703:0--><div data-aura-rendered-by="3664:0" class="objectManagerCustomObjectDeleteWarning" data-aura-class="objectManagerCustomObjectDeleteWarning"><p data-aura-rendered-by="3665:0">Deleting a custom object does the following:</p><ul data-aura-rendered-by="3667:0"><li data-aura-rendered-by="3668:0">Deletes all the data that currently exists in all records of that custom object</li><li data-aura-rendered-by="3670:0">Deletes all tracked history data associated with the custom object</li><li data-aura-rendered-by="3672:0">Deletes the custom tab and list views for the object</li><li data-aura-rendered-by="3674:0">Deletes workflow rules and actions that use the object</li><li data-aura-rendered-by="3676:0">Hides the custom object definition and all related definitions</li><li data-aura-rendered-by="3678:0">Hides the object's data records and all related data records</li><li data-aura-rendered-by="3680:0">Disables report types for which this is the main object</li><li data-aura-rendered-by="3682:0">Disables custom reports for which this is the main object</li><li data-aura-rendered-by="3684:0">Deactivates custom formula fields on the object</li><li data-aura-rendered-by="3686:0">Deactivates custom validation rules and approval processes on the object</li><li data-aura-rendered-by="3688:0">Deactivates and deletes the Lightning Pages associated with the custom object.</li></ul><p data-aura-rendered-by="3690:0">In order to preserve a record of data for future reference, run a data export before deleting custom objects by clicking Data | Data Export.</p><p data-aura-rendered-by="3692:0">After you've deleted this custom object, it appears in the deleted objects list for 15 days. During that time, you can either undelete it to restore it and all the data stored in it, or delete it permanently. When you undelete a custom object, some of its properties might be lost or changed. After 15 days, the object and its data are permanently deleted.</p></div></div><div class="modal-footer slds-modal__footer" data-aura-rendered-by="3737:0"><div data-aura-rendered-by="3721:0" class="forceModalActionContainer--footerAction forceModalActionContainer" data-aura-class="forceModalActionContainer--footerAction forceModalActionContainer"><button class="slds-button slds-button--neutral uiButton--default uiButton--brand uiButton forceActionButton" aria-live="off" type="button" title="delete" data-aura-rendered-by="3728:0" data-aura-class="uiButton--default uiButton--brand uiButton forceActionButton"><!--render facet: 3729:0--><span class=" label bBody" dir="ltr" data-aura-rendered-by="3731:0">Delete</span><!--render facet: 3726:0--></button></div></div></div></div></div>
我尝试用这个xpath来定位一个元素:
//div[contains(@class,'modal-container slds-modal__container')]//div[3]//div//button[1]//span[1]
但它不能通过硒定位所以任何人都可以帮助我吗?我想点击删除按钮。
答案
看起来像你的html中有xlink:href名称空间定义命名空间在你的html或删除命名空间xlink:
更新此命名空间:xmlns:xlink="http://www.w3.org/2001/XLINK"
输入中的命名空间:<use xlink:href="/_slds/icons/utility-sprite/svg/symbols.svg?cache=9.8.0#close" lightning-primitive-icon_primitive-icon=""/>
以上是关于无法找到元素,这是在salesforce闪电中删除对象的主要内容,如果未能解决你的问题,请参考以下文章
即使在页面加载后,Salesforce 闪电自定义标签也不会更新