Access denied error ( Visual Studio and WatiN )

后端 未结 3 1334
小蘑菇
小蘑菇 2021-01-06 15:00

I\'m using the WatiN testing tool with Visual Studio 2005. When I try to select a value from my list box I am getting an \"access denied\" error.

3条回答
  •  囚心锁ツ
    2021-01-06 15:36

    I noticed this happens if you try and select a value that is already selected.

    You can work around this with a pre-check:

    if(_sel_ddlPeriodFromDay.GetValue("value")!="1")
       _sel_ddlPeriodFromDay.SelectByValue("1");
    

    or maybe use a try catch?

    try{_sel_ddlPeriodFromDay.SelectByValue("1");}
    catch{}
    

提交回复
热议问题