2017-04-10 9 views
-1

を含むと行を選択し、私は、テキスト=「スケジュールされた」とTDのテキスト=「QAテストCHIRAG」二つの異なるTDテキスト

enter image description here

をtdのた(4行目)以下の行を選択しようとしていますこれは私がこれまでのところ、これはテキストQA TEST CHIRAGを持っている行を選択し、隣接するオープンボタンをクリックして持っているものです。

self.driver.find_element_by_xpath("//tr/td[text()='QA TEST CHIRAG']/./../td/input[@type='Button' and @value = 'Open']").click() 

私は、スケジュールと両方のテキストを持つ行を確認することができますどのように知っていただきたいと思いますQAを試してから、開いているボタンをクリックしてください

+1

'// TR [TD [テキスト()= 'QA TEST CHIRAG']およびTD [テキスト()= "スケジュール"] ]/td/input [@ type = 'Button'と@value = 'Open'] ' – splash58

答えて

1

あなたはこれを言うxpathを書きました。

find an element whose text="QA TEST CHIRAG" > find a sibling td> 
select input elment inside it. 

これを拡張することもできます。言い換えれば

Select td with text=Scheduled > find sibling element with text="QA TEST CHIRAG" > find sibling td > select input element inside it. 

あなたはこのXPathを試すことができます。

self.driver.find_element_by_xpath("//tr/td[text()='Scheduled']/./../td[text()='QA TEST CHIRAG']/./../td/input[@type='Button' and @value = 'Open']").click() 
関連する問題