I am trying to select a parameter from the drop-down list for angular e2e tests using a protractor.
Here is the code snippet for the selection option:
<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>
I tried:
ptor.findElement(protractor.By.css('select option:1')).click();
This gives me the following error:
Invalid or invalid string specified. Build information: version: '2.35.0', version: 'c916b9d', time: '2013-08-12 15:42:01' System information: os.name: "Mac OS X", os.arch: ' x86_64 ', os.version: '10 .9', java.version: '1.6.0_65' Driver Information: driver.version: unknown
I also tried:
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();
This gives me the following error:
ElementNotVisibleError: the element is currently not visible and therefore cannot interact with the Duration of the command or timeout: 9 milliseconds Assembly information: version: '2.35.0', version: 'c916b9d', time: '2013-08-12 15 : 42: 01 'System information: os.name:' Mac OS X ', os.arch:' x86_64 ', os.version: '10 .9', java.version: '1.6.0_65' Session ID: bdeb8088-d8ad- 0f49-aad9-82201c45c63f Driver Information: org.openqa.selenium.firefox.FirefoxDriver Features [{platform = MAC, acceptSslCerts = true, javascriptEnabled = true, browserName = firefox, rotatable = false, locationContextEnabled = true, version = 24.0 = true, databaseEnabled = true, handlesAlerts = true, browserConnectionEnabled = true, nativeEvents = false, webStorageEnabled = true, applic ationCacheEnabled = false, accepts Screenshot = true}]
Can someone help me with this problem or throw some light on what I can do wrong here.
javascript angularjs selenium testing protractor
Ranjan Bhambroo Oct 25 '13 at 21:08 2013-10-25 21:08
source share