簡體   English   中英

無法在Selenium中將TransparentProxy強制轉換為SelectElement

[英]Unable to cast TransparentProxy to SelectElement in Selenium

我試圖在Selenium腳本IWebElementSelectElement ,如下所示:

 SelectElement selectCalendar = (SelectElement)orderPage.CalendarType;

...但是我收到以下錯誤提示: System.InvalidCastException : Unable to cast transparent proxy to type 'OpenQA.Selenium.Support.UI.SelectElement'

我不知道這個錯誤意味着什么。 我該如何解決?

它不應該直接進行類型轉換

SelectElement selectCalendar = new SelectElement(orderPage.CalendarType);

這將解決上述問題

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM