マイページには次の2つのボタンがあります。ここでは、2つのうちの1つの「次へ」ボタンをクリックする必要があります。ここでの問題は、両方の次のボタンは、同じHTMLコンテンツを持っています。彼らは一意のIDを持っていますが、静的なone.Itは動的なものであり、常に変更されます。 どのようにして要素を識別できますか?私は[次へ]ボタン2.Hereのために追加した親コードに続いて同じページにある2つの次のボタンのxpathを作成する方法
我々はUIDと呼ばれる唯一の一意の識別子があります:あなたは私が私のXPathの作成にこれを使用することができますどのように私を助けてください「navigationPanel」 .Couldを?
<div id="idx_layout_ContentPane_102" class="dijitContentPane idxContentPane wizardNavigationPanel wizardNavigationPanelBottom" data-mojo-props=" 'class' : 'wizardNavigationPanel wizardNavigationPanelBottom' , uId : 'navigationPanel' , renderHidden : true ,scParamDataFn : function() { return { 'aria-label' : this.getSimpleBundleString('Region_wizard_navigation') } } " data-mojo-type="idx/layout/ContentPane" role="region" aria-label="Wizard navigation" widgetid="idx_layout_ContentPane_102">
<span class="dijit dijitReset dijitInline dijitButton idxButtonDerived navPrevious" role="presentation" widgetid="dijit_form_Button_11">
<span class="dijit dijitReset dijitInline idxButtonDerived idxSpecialButton navNext dijitButton" role="presentation" widgetid="dijit_form_Button_12">
<span class="dijitReset dijitInline dijitButtonNode" role="presentation" data-mojo-attach-event="ondijitclick:__onClick">
<span id="dijit_form_Button_12" class="dijitReset dijitStretch dijitButtonContents" aria-labelledby="dijit_form_Button_12_label" role="button" data-mojo-attach-point="titleNode,focusNode" tabindex="0" style="-moz-user-select: none;">
<span class="dijitReset dijitInline dijitIcon idxNextPageIcon" data-mojo-attach-point="iconNode"/>
<span class="dijitReset dijitToggleButtonIconChar">●</span>
<span id="dijit_form_Button_12_label" class="dijitReset dijitInline dijitButtonText" data-mojo-attach-point="containerNode">Next</span>
</span>
</span>
<input class="dijitOffScreen" type="button" data-mojo-attach-point="valueNode" aria-hidden="true" role="presentation" tabindex="-1" data-mojo-attach-event="onclick:_onClick" value=""/>
</span>
IDがalways.Iこの試し "次へ" ボタン1
あなたの「次へ」ボタンで最初に一致したノードは、取得しますこれらのボタンの親の助けを借りてください。ボタンの前後にHTMLを貼り付けることができます。 – Paras
@pArAs親コードを更新しました。** uId **と呼ばれる一意の識別子が1つあります。xpathでどのように使用できるのか教えてください。 –