分度器を使用して角度のある e2e テストのドロップダウンからオプションを選択しようとしています。
select オプションのコード スニペットは次のとおりです。
<select id="locregion" class="create_select ng-pristine ng-invalid ng-invalid-required" required="" ng-disabled="organization.id !== undefined" ng-options="o.id as o.name for o in organizations" ng-model="organization.parent_id">
<option value="?" selected="selected"></option>
<option value="0">Ranjans Mobile Testing</option>
<option value="1">BeaverBox Testing</option>
<option value="2">BadgerBox</option>
<option value="3">CritterCase</option>
<option value="4">BoxLox</option>
<option value="5">BooBoBum</option>
</select>
私が試してみました:
ptor.findElement(protractor.By.css('select option:1')).click();
これにより、次のエラーが表示されます。
無効または不正な文字列が指定されました ビルド情報: バージョン: '2.35.0'、リビジョン: 'c916b9d'、時刻: '2013-08-12 15:42:01' システム情報: os.name: 'Mac OS X' 、os.arch: 'x86_64'、os.version: '10.9'、java.version: '1.6.0_65' ドライバー情報: driver.version: 不明
私も試しました:
ptor.findElement(protractor.By.xpath('/html/body/div[2]/div/div[4]/div/div/div/div[3]/ng-include/div/div[2]/div/div/organization-form/form/div[2]/select/option[3]')).click();
これにより、次のエラーが表示されます。
ElementNotVisibleError: 要素は現在表示されていないため、操作できない可能性があります コマンドの実行時間またはタイムアウト: 9 ミリ秒 ビルド情報: バージョン: '2.35.0'、リビジョン: 'c916b9d'、時間: '2013-08-12 15:42: 01' システム情報: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9', java.version: '1.6.0_65' セッション ID: bdeb8088-d8ad-0f49-aad9 -82201c45c63f ドライバー情報: org.openqa.selenium.firefox.FirefoxDriver 機能 [{platform=MAC, acceptSslCerts=true, javascriptEnabled=true, browserName=firefox, rotatable=false, locationContextEnabled=true, version=24.0, cssSelectorsEnabled=true, databaseEnabled =true、handlesAlerts=true、browserConnectionEnabled=true、nativeEvents=false、webStorageEnabled=true、applicationCacheEnabled=false、takesScreenshot=true}]
誰でもこの問題を手伝ってくれるか、ここで間違っている可能性があることに光を当ててください。