2017-09-19 11 views
1

Specflow 1.5.2 with Specflow 2.1.0を使用してテストを実行する。私はテストがセレンを使用して長時間待つことを中止している問題を抱えています。10分以上のセレン待ち時間を実行したときのテスト実行時のスペック・タイムアウト

WebDriverWait wait = new WebDriverWait(_driver, TimeSpan.FromHours(1)); 
 
       
 
       wait.PollingInterval = TimeSpan.FromMinutes(10); 
 
       wait.Timeout = TimeSpan.FromHours(1); 
 
       //TimeSpan.MaxValue.TotalHours 
 
       wait.IgnoreExceptionTypes(typeof(ThreadAbortException)); 
 
       wait.IgnoreExceptionTypes(typeof(NoSuchElementException)); 
 
      
 
    wait.Until(ExpectedConditions.TextToBePresentInElementLocated(By.XPath($"//*[@data-ths=\"engagement_{EngagementId}\"]/../div[1]/span[2]"), "Ready"));

Whether I run the test from the command line or from within Visual Studio Enterprise using C#, I get the following exception:

TechTalk.SpecRun.Framework.SpecRunException:少なくとも1つのテストスレッドが中断されました。 ---> System.ServiceModel.CommunicationObjectFaultedException:通信オブジェクトSystem.ServiceModel.Channels.ServiceChannelは、フォルト状態にあるため通信に使用できません。

サーバースタックトレース:System.ServiceModel.Channels.ServiceChannel.Call(文字列アクション、ブール一方向、ProxyOperationRuntime動作時System.ServiceModel.Channels.CommunicationObject.ThrowIfFaulted() で、オブジェクト[]イン、オブジェクト[]アウト、のTimeSpanタイムアウト)System.ServiceModel.Channels.ServiceChannelProxy.InvokeでSystem.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCallで、ProxyOperationRuntime動作) で(IMessageがメッセージ)[0]で

例外再スロー: (IMessage reqMsg、IMessage retMsg)TechTalk.SpecRun.Framework.TestThread.Run(ITestExecutionManager executionManagerForRunでTechTalk.SpecRun.Framework.IOutProcTestAssemblyExecutor.RunTestsでSystem.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(のMessageData & msgData、のInt32型)で (TestThreadState testThreadState) ) TechTalk.SpecRun.Framework.AsyncTestThreadRunner.RunSync(TestExecutionManager executionManager) ---内部例外スタックトレースの終了--- 結果:テストフレームワークエラー:少なくとも1つのテストスレッドが異常終了しました。 合計:1(テスト実行:0) が成功:0 無視されます:0 保留:0 スキップ:0 に失敗しました:0

> Here is my default.srprofile after removing 'apartmentStatew' parameter hoping it would resolve it: 
 

 
<?xml version="1.0" encoding="utf-8"?> 
 
<TestProfile xmlns="http://www.specflow.org/schemas/plus/TestProfile/1.5"> 
 
    <Settings projectName="Symphony.AcceptanceTests" projectId="{04deb5e2-c1a0-4b15-930d-8247c4d4954b}" /> 
 
    <Execution retryFor="None" stopAfterFailures="-1" testThreadCount="3" testSchedulingMode="Sequential" /> 
 
    <!--<Execution retryFor="None" stopAfterFailures="-1" testSchedulingMode="Sequential" />--> 
 
    <Environment testThreadIsolation="Process" /> 
 

 
    <TestAssemblyPaths> 
 
    <TestAssemblyPath>Symphony.AcceptanceTests.dll</TestAssemblyPath> 
 
    </TestAssemblyPaths> 
 
    <DeploymentTransformation> 
 
    <Steps> 
 
     <RelocateConfigurationFile target="CustomConfig{TestThreadId}.config" /> 
 
     <ConfigFileTransformation configFile="Symphony.AcceptanceTests.dll.config" > 
 
     <Transformation> 
 
      <![CDATA[<?xml version="1.0" encoding="utf-8"?> 
 
\t \t \t \t \t \t \t <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> 
 
           <appSettings> 
 
           <add key="browser" value="{Target}" 
 
           xdt:Locator="Match(key)" xdt:Transform="SetAttributes(value)" /> 
 
           </appSettings> 
 
\t \t \t \t \t \t \t </configuration> 
 
\t \t \t \t \t \t ]]> 
 
     </Transformation> 
 
     </ConfigFileTransformation> 
 
    </Steps> 
 
    </DeploymentTransformation> 
 

 
    <Targets> 
 
    <Target name="Edge"> 
 
     <Filter>Browser_Edge</Filter> 
 
    </Target> 
 
    <Target name="GhostDriver"> 
 
     <Filter>Ghost_Driver</Filter> 
 
    </Target> 
 
    <Target name="Chrome"> 
 
     <Filter>Browser_Chrome</Filter> 
 
    </Target> 
 
    <Target name="Firefox"> 
 
     <Filter>Browser_Firefox</Filter> 
 
    </Target> 
 
    <Target name="Safari"> 
 
     <Filter>Browser_Safari</Filter> 
 
    </Target> 
 
    <Target name="API"> 
 
     <Filter>API</Filter> 
 
    </Target> 
 
    <Target name="IE"> 
 
     <Filter>Browser_IE</Filter> 
 
    </Target> 
 
    </Targets> 
 

 
    <TestThreads> 
 
    <TestThread id="0"> 
 
     <TestAffinity>testPath:Target:Chrome</TestAffinity> 
 
    </TestThread> 
 
    <TestThread id="1"> 
 
     <TestAffinity>testPath:Target:API</TestAffinity> 
 
    </TestThread> 
 
    <TestThread id="2"> 
 
     <TestAffinity>testPath:Target:Edge</TestAffinity> 
 
    </TestThread> 
 
    </TestThreads> 
 
</TestProfile> 
 

 

 
    
 

 

+0

なぜ自動テストで10分以上待つ必要がありますか? – JeffC

+0

アプリケーションの性質。サードパーティ製のシステムで処理されているものがあり、そのプロセスが完了するまでには1時間ほどかかることがあります – user5199

+0

その後、自動化の候補とは思えません。 – JeffC

答えて

1

これはSpecFlowのバグでした+バージョン1.6.3で修正されるランナー。

関連する問題