c#-硒中的水平滚动,控件位于网格内

时间:2018-09-24 12:05:52

标签: c# .net selenium selenium-webdriver scroll

我试图滚动到数据表内的控件(下拉列表框),该数据表的位置在第16列以下,并且不显示在默认页面视图上。

这是我的C#代码

IWebElement drpToleranceArrow = lib.initializeTest.driver.FindElement(By.XPath("//mat-select[contains(@ng-reflect-name, 'drpTolerance')]/div[@class='mat-select-trigger']/div[@class='mat-select-arrow-wrapper']/div[@class='mat-select-arrow']"));
var element = drpToleranceArrow  as IWrapsElement;
var locatableElement = element.WrappedElement as ILocatable;
var pos = locatableElement.LocationOnScreenOnceScrolledIntoView;

它引发对ILocatable的期望,期望是

System.NullReferenceException: 'Object reference not set to an instance of an object.'

任何线索?

0 个答案:

没有答案