2017-09-19 5 views
1

Specflow 1.5.2 with Specflow 2.1.0을 사용하여 테스트를 실행합니다. 나는 테스트가 셀레늄을 사용하여 오랜 시간 동안 기다리는 문제를 겪고있다. 왜냐하면 나는 현재 주변에 방법이 있기 때문이다. 셀레늄 대기를 10 분 이상 수행 할 때 테스트 실행시 Specrun timeout

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 : 적어도 하나의 테스트 스레드가 중단되었습니다. ---> System.ServiceModel.CommunicationObjectFaultedException : 통신 개체 인 System.ServiceModel.Channels.ServiceChannel은 오류 상태이므로 통신에 사용할 수 없습니다.

서버 스택 추적 : System.ServiceModel.Channels.ServiceChannel.Call (문자열 액션, 부울 한방향, ProxyOperationRuntime 운전시 System.ServiceModel.Channels.CommunicationObject.ThrowIfFaulted() 에서 , 객체 [] 인 개체 [] 아웃, 타임 아웃 시간 범위)에서 System.ServiceModel.Channels.ServiceChannelProxy.Invoke System.ServiceModel.Channels.ServiceChannelProxy.InvokeService (methodCall을 IMethodCallMessage, ProxyOperationRuntime 동작)에서 (iMessage를 메시지) [0]에

예외 재 throw : (IMessage reqMsg, IMessage retMsg)TechTalk.SpecRun.Framework.TestThread.Run에서 TechTalk.SpecRun.Framework.IOutProcTestAssemblyExecutor.RunTests (TestThreadState testThreadState) 에서 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke (MessageData & msgData, INT32 타입)에 (ITestExecutionManager executionManagerForRun) TechTalk.SpecRun.Framework.AsyncTestThreadRunner.RunSync (TestExecutionManager executionManager) --- 내부 예외 스택 추적 끝 --- 결과 : 테스트 프레임 워크 오류 : 하나 이상의 테스트 스레드가 중단되었습니다. 합계 : 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

응용 프로그램의 성격. 제 3 자 시스템에 의해 처리되는 것이 있으며 그 프로세스가 완료되기까지 최대 1 시간이 걸릴 수 있습니다. – user5199

+0

그러면 자동화를위한 좋은 후보자로 들리지 않습니다. – JeffC

답변

1

이는 SpecFlow의 버그했다 + 버전 1.6.3에서 수정 될 러너.