我在Visual Studio 2010中收到警告消息:「字段永遠不會分配」。 我使用在運行時分配字段的Webdriver PageFactory,如何抑制此消息?字段永遠不會分配警告,使用Webdriver PageFactory
這裏的代碼示例:
public class VideoInfo
{
[FindsBy(How = How.ClassName, Using = "detailsTitle")]
private IWebElement _videoInfoDetailsTitle; //Here is got the warning message
public VideoInfo(IWebDriver webDriver)
{
PageFactory.InitElements(webDriver, this); //Assigen the field
}
}
你不能 「修復」 在您的當前設置。但是,如果您想要,可以禁止該警告:)。 – Styxxy
你是對的,我編輯我的帖子:) 10倍。 – Kaldi