将动作类与Sendkeys(“ 15/16”)结合使用后,如何释放钥匙

时间:2018-11-19 11:38:22

标签: selenium-webdriver

我正在测试一个下拉菜单,其中使用动作类将一个季节选择为“ 16/17”,但是一旦我发送键,它将一次输入正确的值,并且在将控件更改回默认季节之后“ 18/19” ..请告知我如何释放钥匙。 注意:此下拉菜单不支持向下箭头键 使用Firefox + Java +网络驱动程序

Actions builder1 = new Actions(driver);
WebElement mainelement = driver.findElement(By.xpath("//gc-dropdown//div[* 
[contains(text(), 'Season')]]"));
Action SeriesOfActions6=builder1.moveToElement(mainelement).click()
.pause(2000).sendKeys("16/17",Keys.DOWN).click().build();
driver.manage().timeouts().implicitlyWait(30 , TimeUnit.SECONDS);
SeriesOfActions6.perform();

“ 18/19”元素的下拉菜单 <div class="dropdown-display" ng-click="vm.onDropdownClick()" ng-class="{ 'clicked': vm.isDropdownOpen, 'dropdown-mobile' : vm.isMobile}"> <div class="animation ng-binding ng-scope" ng-if="!vm.isFocussed"> 18/19 </div>

“ 16/17”元素<div class="dropdown-item ng-scope" ng-repeat="item in vm.values track by $index" ng-click="vm.onItemClick(item)" ng-class="{ 'selected': item.isSelected}" ng-disabled="item.isDisabled && item !== vm.selectedItem"> <span class="ng-binding">16/17</span>的下拉列表

screenshot of a page

0 个答案:

没有答案