首页 新闻 会员 周边

error: The CurrentThread needs to have it's ApartmentState set to ApartmentState.STA to be able to

0
悬赏园豆:30 [已解决问题] 解决于 2014-08-28 23:58

阅读《Pro Agile .NET Development with Scrum》,在第103页遇到问题。

NUnit运行后出错信息如下:
***** KojackGames.Blackjack.Acc.Tests.Features.GetInvolvedInAGameFeature.MakeABet Given I have navigated to the game play screen to play a hand

-> error: The CurrentThread needs to have it's ApartmentState set to ApartmentState.STA to be able to automate Internet Explorer.

When I click on the bet button

-> skipped because of previous errors

Then I should see the deal button

-> skipped because of previous errors
*****

已经设置了app.config文件,清单如下

<?xml version="1.0" encoding="utf-8" ?>
< configuration>
  <configSections>
   <sectionGroup name="NUnit">
    <section name="TestRunner" type="System.Configuration.NameValueSectionHandler"/>
   </sectionGroup>
  </configSections>
  <NUnit>
   <TestRunner>
    <!-- Valid values are STA,MTA. Others ignored. -->
    <add key="ApartmentState" value="STA" />
   </TestRunner>
  </NUnit>
< /configuration>

liesl的主页 liesl | 初学一级 | 园豆:57
提问于:2014-07-22 14:54
< >
分享
最佳答案
0

你是英文看不懂,还是看得懂,但是不知道什么意思?

收获园豆:30
Launcher | 高人七级 |园豆:45045 | 2014-07-22 15:02

刚才是英文提问,现在修改成用中文提问了。

liesl | 园豆:57 (初学一级) | 2014-07-22 15:07

@liesl: 帮我把这句:The CurrentThread needs to have it's ApartmentState set to ApartmentState.STA to be able to automate Internet Explorer. 翻译成中文。

Launcher | 园豆:45045 (高人七级) | 2014-07-22 15:09

@Launcher: 这个就是出错信息

liesl | 园豆:57 (初学一级) | 2014-07-22 16:14

@liesl: 能翻译成中文不?英文的我看不懂! The 是啥意思? needs to  是啥意思?

Launcher | 园豆:45045 (高人七级) | 2014-07-22 16:15

@Launcher: 不知道答案不用继续留言了。

liesl | 园豆:57 (初学一级) | 2014-07-22 16:17

@liesl: 我翻了下 NUnit 的文档,找到了答案,但是因为是英文,你看不懂,我就不贴了。

Launcher | 园豆:45045 (高人七级) | 2014-07-22 16:21

@Launcher: 你翻不到,因为这个不是NUnit的问题,是WatiN的设置问题。所以你如果有时间,就去学习吧,然后再来帮助别人,而不是闲扯。

liesl | 园豆:57 (初学一级) | 2014-07-22 16:32

@liesl: 这样啊,我看你的配置:

<configSections>
   <sectionGroup name="NUnit">
    <section name="TestRunner" type="System.Configuration.NameValueSectionHandler"/>
   </sectionGroup>
  </configSections>
  <NUnit>
   <TestRunner>
    <!-- Valid values are STA,MTA. Others ignored. -->
    <add key="ApartmentState" value="STA" />
   </TestRunner>
  </NUnit>

跟配置 NUnit 是一样的,我以为是 NUnit 呢!

Launcher | 园豆:45045 (高人七级) | 2014-07-22 16:38
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册