我在C#中有以下代码:
- namespace Tests
- {
- [SetUpFixture,RequiresSTA]
- public class Setup
- {
- public IE Window = new IE("webpage");
- [SetUp]
- public void SetUp()
- {
- }
- [TearDown]
- public void TearDown()
- {
- }
- }
- }
当我尝试使用我的网站运行它时,它返回错误:
“The currentthread needs to have its apartmentstate set to
ApartmentState.sta to be able to initiate Internet Explorer”
通常在使用除SetupFixture之外的任何东西时,需要将其作为解决方案.但由于某种原因,它现在不起作用.