0

投稿ボタンをクリックした後、私はスパンタグの動的テキスト変更を処理する

のいずれかの状態の情報を取得します。 注文書PO001007を確認してから押してください。

2)注文番号のタリープッシュ - 成功条件のため

成功PO001008は、このXPathを使用しています

.//*[@id='wrap']/div[2]/div[2]/div/div[4]/span[text()='Tally push of order no - PO001008 successful'] 

が、内部のたびに変更されているテキスト私はこのXPathのに使用している場合はそう.//*[@id='wrap']/div[2]/div[2]/div/div[4]/span

これはパスとしても失敗状態になります。誰でもスパンタグ内でこの動的テキストの変更を処理する方法を教えてください

成功した注文については、この

///button[@class='close']/following::span[contains(text(),'Invalid')] 

を使用失敗した注文について

:低は成功と失敗の両方の症状のための私のHTMLコード

<div class="alert alert-info alert-dismissable"> 
<button class="close" type="button" data-dismiss="alert" aria-hidden="true">×</button> 
<span>Invalid states information found. Please verify the order PO001007 and then push.</span> 
</div> 
----------------------------------------- 

<div class="alert alert-info alert-dismissable"> 
<button class="close" type="button" data-dismiss="alert" aria-hidden="true">×</button> 
<span>Tally push of order no - PO001008 successful</span> 
</div> 
+0

場所を特定したいものを私は – iamsankalp89

+0

iが

Tally push of order no - PO001008 successful
この要素を探し内のテキストはどのようにこの – joy

+0

[OK]を、それを持って変更されますまたがるしたい教えてください私は、XPathは私が考えるこの – iamsankalp89

答えて

0

であるあなたは

これを試してみてください、このXPathを使用する必要がありますこれを使用する

//button[@class='close']/following::span[contains(text(),'order no')] 
+0

私は失敗メッセージを取得する場合 -

Invalid states information found. Please verify the order PO001007 and then push.
このxpathはこのdivも同じ場所に配置されています – joy

+0

私の成功条件では、失敗メッセージであっても真実を示しています – joy

+0

両方の結果が同じページに表示されます – iamsankalp89

関連する問題