2017-03-05 3 views
0

を埋める私はセレンを経由して、次の要素を割り当てることができなかった(私が見つけて、テキスト(ID)とそれを埋める必要があります。セレン - 発見し、要素

    <tr> 
        <th class="col-md-3 basicPropertiesName">Id</th> 
        <td class="col-md-9"> 
         <input class="form-control ng-pristine ng-valid ng-     touched" ng-keypress="keypressHandler($event, 2)" ng-model="newInsight.id" placeholder="ID"> 
        </td> 
       </tr> 

答えて

0

たぶん、あなたは

By(xpath("//input[@ng-model='newInsight.id'])) 
このようなものが必要?
0

それともこれ?

$("input[ng-model='newInsight.id']").setValue(value); 
0
$(By.xPath("//tr[./th[text()='Id']]")).find("input").setValue("some text) 

または追加なしfind()

$(By.xPath("//tr[./th[text()='Id']]//input")).setValue("some text) 
0

また、CSSセレクタを使用して次のオプションを使用することもできます。

String str="th[class*='basicPropertiesName']"; 
SelenideElement element =$(str); 

または

String str="th:contains('Id')"; 
SelenideElement element =$(str); 
関連する問題