2016-04-12 10 views
0

マイページには次の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

+0

あなたの「次へ」ボタンで最初に一致したノードは、取得しますこれらのボタンの親の助けを借りてください。ボタンの前後にHTMLを貼り付けることができます。 – Paras

+0

@pArAs親コードを更新しました。** uId **と呼ばれる一意の識別子が1つあります。xpathでどのように使用できるのか教えてください。 –

答えて

0

を特定する必要が変化するであろう。exprnの終わりにここ

//*[contains(@class,'flagButtonText') and contains(@id,'flag_form_Button')][1] 

[1]あなたがする必要がある。この場合、1

+0

私はそれに従ってみましたが、すべてのボタンを識別しています。最初のものではありません。あなたのウェブページへのリンクを送ってください。** ** * * [(@ class、 'book flagInline flagButtonText'を含む)、(@ data-mojo-attach-point、 'containerNode')] [1] ** –

+0

あなたが公開したくない場合 - 私のGmailに送る:: [email protected] –

+0

VPNなしでリンクにアクセスすることはできません。詳細が必要な場合は教えてください。私はHTMLコード全体を貼り付けました特定のblog.Inは、私は1つのユニークなIDをuIdと呼ばれる、それを使用して私は私のxpathを作成することができます。 –

関連する問題