HTML code:
HardCodedDatabase.testID testObjet = new HardCodedDatabase.testID();
testObjet.testName = "test1";
testObjet.manoeuvres.Add(new manoeuvresID(){manName ="man1"});
List<HardCodedDatabase.testID> listForTesting = new List<HardCodedDatabase.testID>();
listForTesting.Add(testObjet);
<div class="ngrs-range-slider ng-isolate-scope" range-slider="" min="0" max="30" attach-handle-values=
"true" model-min="experience.minVal" model-max="experience.maxVal" style="margin: 28px 0px 0px 0px;">
`<div class="ngrs-runner"><div class`="ngrs-handle ngrs-handle-min" style="left: 0%;"><i></i></div>
<div class="ngrs-handle ngrs-handle-max" style="left: 10%;"><i></i></div>
如何拖动滑块,我尝试使用css选择器,但它无效。
在我的问题中,我只得到X位置定位器值而不是Y位置定位器值,我只有两个类值,即:<div class="ngrs-value-runner ngrs-attached-handles"><div class="ngrs-value ngrs-value-min ng-hide" ng-show="showValues" style="left: 3.33333%;"><div class="ng-binding">1</div></div>
<div class="ngrs-value ngrs-value-max ng-hide" ng-show="showValues" style="left: 10%; right: auto;"><div class="ng-binding">3</div></div></div></div>
和ngrs-handle ngrs-handle-min
使用这两个值如何拖动滑块。
答案 0 :(得分:0)
最后我找到了答案
this.test_slider = function(){
var sliderBar = ptor.findElement(protractor.By.css(".ngrs-handle.ngrs-handle-max"));
browser.actions().dragAndDrop(sliderBar,{x:50,y:0}).perform();
ptor.sleep(10000);
expect(sliderBar.getAttribute('value')).toEqual('7');
};