This is a migrated thread and some comments may be shown as answers.

Executing Telerik Tests in Microsoft Test Manager (MTM)

12 Answers 102 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Niharika
Top achievements
Rank 1
Niharika asked on 10 Jan 2015, 01:58 AM
Hello
Telerik Team, 

I am facing some issues which executing test studio tests from MTM.

We currently have a UI test suite with about 400+ test cases. We have been facing numerous issues when we try to execute the test studio tests from MTM.

Though all the tests are working correctly when executed locally, I get the below errors from MTM. Strangely, all the tests are in the same solution and same
.dlls. Also, the 1st step of logging into the environment is the same in all of the 3 tests, yet they run to different point through MTM and then fail. I have
verified that all the tests are present in the build folder along with the correct association. 

Error 1:

'1/9/2015 1:46:39 PM' - Executing test: 'abc', path: ......'
'1/9/2015 1:46:39 PM' - Using .Net Runtime version: '4.0.30319.34014' for test execution.
Build version is '2014.4.1211.0'.

'1/9/2015 1:46:39 PM' - Starting execution....
'1/9/2015 1:46:44 PM' - Detected custom code in test. Locating test assembly:….
'1/9/2015 1:46:44 PM' - Failure detected during execution. Details:

------------------------------------------------------------

'1/9/2015 1:46:44 PM' - System.IO.FileNotFoundException: Unable to find the code behind assembly. Please make sure you have compiled your code
behind without errors before attempting to execute the test. 

Error 2:

'1/9/2015 1:43:09 PM' - Executing test: 'efg', path: '.....'

'1/9/2015 1:43:09 PM' - Using .Net Runtime version: '4.0.30319.34014' for test execution.
Build version is '2014.4.1211.0'.

'1/9/2015 1:43:09 PM' - Starting execution....

'1/9/2015 1:43:13 PM' - Detected custom code in test. Locating test assembly: ….

'1/9/2015 1:43:13 PM' - Assembly Found: ….

'1/9/2015 1:43:13 PM' - Loading code class: 'Class;.

------------------------------------------------------------

------------------------------------------------------------

'1/9/2015 1:43:13 PM' - Enabling Html Popup Tracker. Test expecting Popups.

'1/9/2015 1:43:13 PM' - Using 'InternetExplorer' version '11.0' as default browser.

'1/9/2015 1:43:13 PM' - 'Fail' : 1. Execute test '…'

InnerException:

System.IO.FileNotFoundException: Unable to find test'….tstest'

   at
ArtOfTest.WebAii.Design.Execution.ExecutionEngine.ExecuteTestInCurrentContext(String
relativeTestPath)

   at
ArtOfTest.WebAii.Design.IntrinsicTranslators.Descriptors.ExecuteTestActionDescriptor.Execute(IAutomationHost
autoHost, TestAsStepResult result)

   at
ArtOfTest.WebAii.Design.Execution.ExecutionEngine.ExecuteStep(Int32 order)

------------------------------------------------------------

'1/9/2015 1:43:13 PM' - Detected a failure. Step is
marked 'ContinueOnFailure=False' aborting test execution.

------------------------------------------------------------

'1/9/2015
1:43:13 PM' - Overall Result: Fail

'1/9/2015
1:43:13 PM' - Duration: [0 min: 0 sec: 171 msec]

------------------------------------------------------------

'1/9/2015
1:43:13 PM' - Test completed! 

Error 3:

It fails to find an image on the UI, though the image exists. 

------------------------------------------------------------

'1/9/2015 10:08:10 AM' - Executing test: 'Test3', path: 'Test3.tstest.'

'1/9/2015 10:08:10 AM' - Using .Net Runtime version: '4.0.30319.34014' for test
execution. Build version is '2014.4.1211.0'.

'1/9/2015 10:08:10 AM' - Starting execution....

------------------------------------------------------------

------------------------------------------------------------

'1/9/2015 10:08:15 AM' - Enabling Html Popup Tracker. Test expecting Popups.

'1/9/2015 10:08:15 AM' - Using 'InternetExplorer' version '11.0' as default browser.

'1/9/2015 10:09:28 AM' - 'Fail' : 1. Execute test 'Test3':Overall Result: Fail

------------------------------------------------------------

'1/9/2015 10:08:15 AM' - Detected custom code in test. Locating test assembly: ….dll.

'1/9/2015 10:08:15 AM' - Assembly Found:….dll

'1/9/2015 10:08:15 AM' - Loading code class: ….

------------------------------------------------------------

------------------------------------------------------------

'1/9/2015 10:08:15 AM' - Enabling Html Popup Tracker. Test expecting Popups.

'1/9/2015 10:08:15 AM' - Using 'InternetExplorer' version '11.0' as default browser.

'1/9/2015 10:08:15 AM' - 'Pass' : 1. Execute test 1:Overall Result: Pass

------------------------------------------------------------

'1/9/2015 10:08:15 AM' - Detected custom code in test. Locating test assembly:….dll.

'1/9/2015 10:08:15 AM' - Assembly Found:….dll

'1/9/2015 10:08:15 AM' - Loading code class: ….

------------------------------------------------------------

------------------------------------------------------------

'1/9/2015 10:08:15 AM' - Enabling Html Popup Tracker. Test expecting Popups.

'1/9/2015 10:08:15 AM' - Using 'InternetExplorer' version '11.0' as default browser.

'1/9/2015 10:08:15 AM' - 'Pass' : 1. Set Environment Type

------------------------------------------------------------

'1/9/2015 10:08:15 AM' - Overall Result: Pass

'1/9/2015 10:08:15 AM' - Duration: [0 min: 0 sec: 0 msec]

------------------------------------------------------------<<<
Test-as-Step '

'1/9/2015 10:09:28 AM' - 'Fail' : 3. Execute test ….tstest' log starts:Overall Result:
Fail

------------------------------------------------------------

'1/9/2015 10:08:15 AM' - Detected custom code in test. Locating test assembly:%%%.dll.

'1/9/2015 10:08:15 AM' - Assembly Found:...dll

'1/9/2015 10:08:15 AM' - Loading code class: ….

------------------------------------------------------------

------------------------------------------------------------

'1/9/2015 10:08:15 AM' - Enabling Html Popup Tracker. Test expecting Popups.

'1/9/2015 10:08:15 AM' - Using 'InternetExplorer' version '11.0' as default browser.

'1/9/2015 10:08:28 AM' - 'Pass' : %%%- 'Pass' : 1. %%% log starts:Overall Result: Pass

------------------------------------------------------------

'1/9/2015 10:08:15 AM' - Detected custom code in test. Locating test assembly: ….dll.

'1/9/2015 10:08:15 AM' - Assembly Found: ….dll

'1/9/2015 10:08:15 AM' - Loading code class: ….

------------------------------------------------------------

------------------------------------------------------------

'1/9/2015 10:08:15 AM' - Enabling Html Popup Tracker. Test expecting Popups.

'1/9/2015 10:08:15 AM' - Using 'InternetExplorer' version '11.0' as default browser.

'1/9/2015 10:08:23 AM' - 'Pass' : 1. Navigate to : ' ###

'1/9/2015 10:08:28 AM' - 'Pass' : 2. Wait for '5000' msec.

'1/9/2015 10:08:28 AM' - 'Pass' : 3. Handle '...' dialog. - DataDriven:
[$(LoginID)][$(Password)][$(WaitInterval)]

------------------------------------------------------------

'1/9/2015 10:08:28 AM' - Overall Result: Pass

'1/9/2015 10:08:28 AM' - Duration: [0 min: 13 sec: 84 msec]

------------------------------------------------------------<<<
Test-….tstest' log ends.

 

<<<
Step log ends.'1/9/2015 10:09:28 AM' - 'Fail' : 2. Execute test 'HandleDialog'

….tstest'
log starts:Overall Result: Fail

------------------------------------------------------------

'1/9/2015 10:08:28 AM' - Detected custom code in test. Locating test assembly: ....dll.

'1/9/2015 10:08:28 AM' - Assembly Found: ….dll

'1/9/2015 10:08:28 AM' - Loading code class: ….HandleDialog'.

------------------------------------------------------------

------------------------------------------------------------

'1/9/2015 10:08:28 AM' - Enabling Html Popup Tracker. Test expecting Popups.

'1/9/2015 10:08:28 AM' - Using 'InternetExplorer' version '11.0' as default browser.

'1/9/2015 10:08:28 AM' - 'NotRun' : 1. Wait for '5000' msec.

'1/9/2015 10:09:28 AM' - 'Fail' : 2. Wait for element 'Image'
'is' visible.

------------------------------------------------------------

Failure
Information:

~~~~~~~~~~~~~~~

Unable
to find the target host (Browser/SilverlightApp) to locate an element. Failure:
Waiting for frame
'[Frame:id=InlineDialog_Iframe,name=InlineDialog_Iframe,src=^/_forms/navtour/dlg_navtour.aspx,UseQuery:False]'
timed out. Error: Wait for condition has timed out

InnerException:

System.Exception:
Unable to find the target host (Browser/SilverlightApp) to locate an element.
Failure: Waiting for frame
'[Frame:id=InlineDialog_Iframe,name=InlineDialog_Iframe,src=^/_forms/navtour/dlg_navtour.aspx,UseQuery:False]'
timed out. Error: Wait for condition has timed out

  
at
ArtOfTest.WebAii.Design.Execution.ExecutionUtils.WaitForAllElements(IAutomationHost
host, AutomationDescriptor descriptor, Int32 timeout)

  
at ArtOfTest.WebAii.Design.Execution.ExecutionEngine.ExecuteStep(Int32 order)

------------------------------------------------------------

'1/9/2015
10:09:28 AM' - Detected a failure. Step is marked 'ContinueOnFailure=False'
aborting test execution.

------------------------------------------------------------

'1/9/2015
10:09:28 AM' - Overall Result: Fail

'1/9/2015
10:09:28 AM' - Duration: [1 min: 0 sec: 310 msec]

Please could you help me in debugging this issue? Why is it that it runs until a certain point in the 3rd case, and fails in the 1st and 2nd case? Even though
the initial steps are the same?  

Also, I'm not sure why it fails to find the image when run through MTM, and works fine locally. Am I missing something?
 

Thanks,

Niharika

 


12 Answers, 1 is accepted

Sort by
0
Ivaylo
Telerik team
answered on 14 Jan 2015, 04:08 PM
Hello Niharika,

Please make sure you have the deployment enabled. Also please make sure that the Copy to Output Directory property of each test is set to Copy Always as shown in the screenshot attached.

Regards,
Ivaylo
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Niharika
Top achievements
Rank 1
answered on 15 Jan 2015, 10:28 PM
Hi Ivaylo,

I have enabled deployment and set the property 'copy to output directory'?

I still does not solve the above problem.
When I execute the tests, sometimes the browser this opens and closes. Its different for different tests and I'm not sure what is missing. Any help would be appreciated.

Thank you,
Niharika
0
Niharika
Top achievements
Rank 1
answered on 19 Jan 2015, 05:44 PM
Reposting here to avoid duplicates.


We have a UI automation suite of about 500 test cases. All the tests work correctly when executed locally. We are facing issues with executing the automation suite on the test agent using MTM. 

For each of the ui automated tests, the first few steps are common. But somehow, when executed through MTM, each test executes to different lengths and then fail. We are not able to execute any test completely. Sometimes, the browser window just opens
and closes. I have verified and all the files are present in the Test agent. 

Please could you help us resolve this issue? 

Below are the common errors we get through MTM.
 

1.       Exception thrown executing coded step: 'ChoseTheEnvBasedon'EnvironmentType' Value'.

InnerException:
System.ExecutionEngineException:
Navigate to : '/main.aspx' ---> ArtOfTest.Common.Design.Exceptions.ExecutionException:
Unable to resolve the passed uri '/main.aspx' to an absolute url. --->
System.UriFormatException: Unable to resolve the passed uri '/main.aspx' to an absolute url.
 

2.       The test automation associated with the following test case could not be found: [1245706]. Run the test case again using a build that contains the binary with the test automation. 

 

3.       '1/14/2015 12:49:49 PM' - Failure detected during execution. Details:

'1/14/2015
12:49:49 PM' - System.IO.FileNotFoundException: Unable to find the code behind assembly. Please make sure you have compiled your code behind without errors before attempting to execute the test. Looking for: 'Projectname.dll'

If you are running VS 2010, make sure Deployment is checked in your .settings file (in the
solution items)

   at
ArtOfTest.WebAii.Design.Execution.ExecutionUtils.EnsureAssemblyExists(String
assembly, String folder)

   at
ArtOfTest.WebAii.Design.Execution.ExecutionUtils.EnsureAssemblyExists(Test
testcase, String folder)

   at
ArtOfTest.WebAii.Design.Execution.ExecutionUtils.CreateCodedTestInstance(Test
test, TestResult result, String binariesFolder)

   at
ArtOfTest.WebAii.Design.Execution.ExecutionEngine.InternalExecuteTest(Test
test, TestResult initializationResult)

   at
ArtOfTest.WebAii.Design.Execution.TestExecuteProxy.ExecuteTest(ExecuteTestCommand
command)

 

These are some of the errors from EventViewer

Error 1

(QTDCAgent32.exe, PID
1180, Thread 7) GetCollectorType: Failed to get type for Collector
'Microsoft.VisualStudio.TraceCollector.TraceDebuggerDataCollector,
Microsoft.VisualStudio.TraceCollector, Version=10.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a': System.IO.FileLoadException: Could not load
file or assembly 'Microsoft.VisualStudio.TraceCollector, Version=10.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies.
The located assembly's manifest definition does not match the assembly
reference. (Exception from HRESULT: 0x80131040)

File name:
'Microsoft.VisualStudio.TraceCollector, Version=10.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a'

at
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError,
Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark,
IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack
type)

at System.RuntimeTypeHandle.GetTypeByName(String
name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly,
StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean
loadTypeFromPartialName)

at
System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean
ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)

at
System.Type.GetType(String typeName, Boolean throwOnError)

at
Microsoft.VisualStudio.TestTools.DataCollection.ExecutionPluginManager.GetCollectorType(String
collectorTypeName, Exception& loadException)

WRN: Assembly binding
logging is turned OFF.

To enable assembly
bind failure logging, set the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.

Note: There is some
performance penalty associated with assembly bind failure logging.

To turn this feature
off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

 

Error 2

(QTDCAgent32.exe, PID
1180, Thread 7) GetCollectorType: Failed to get type for Collector
'Microsoft.VisualStudio.TestTools.DataCollection.EventLog.EventLogDataCollector,
Microsoft.VisualStudio.TestTools.DataCollection.EventLog, Version=10.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a': System.IO.FileLoadException:
Could not load file or assembly 'Microsoft.VisualStudio.TestTools.DataCollection.EventLog,
Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of
its dependencies. The located assembly's manifest definition does not match the
assembly reference. (Exception from HRESULT: 0x80131040)

File name: 'Microsoft.VisualStudio.TestTools.DataCollection.EventLog,
Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

at
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError,
Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark,
IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack
type)

at
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError,
Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark,
IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)

at
System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean
ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)

at
System.Type.GetType(String typeName, Boolean throwOnError)

at
Microsoft.VisualStudio.TestTools.DataCollection.ExecutionPluginManager.GetCollectorType(String
collectorTypeName, Exception& loadException)

WRN: Assembly binding
logging is turned OFF.

To enable assembly
bind failure logging, set the registry value
[HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.

Note: There is some
performance penalty associated with assembly bind failure logging.

To turn this feature
off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].
 

I am not able to figure out why these tests are working from MTM. Please could you assist us with this issue? 

Thank you,

Niharika

0
Ivaylo
Telerik team
answered on 20 Jan 2015, 07:50 AM
Hello Niharika,

Thank you for providing me with details.

Please note that from the errors provided only the first error is Test Studio related error. And this is expected behavior since the baseUrl is kept in the Test Studio's settings file which is disregarded by the MTM. In order to overcome this you should need to place the BaseURL within the Navigate Step (please refer to the screenshot attached).

Regarding the second error please make sure the deployment is enabled in visual studio. Here is an article on how to proceed. You may also need to enable the deployment in MTM as well.

Regarding the other errors you need to contact Microsoft support, since they are not Test Studio related.

Regards,
Ivaylo
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Niharika
Top achievements
Rank 1
answered on 20 Jan 2015, 07:30 PM
Thank you for your response. I just had a follow up question.
Since MTM ignores the URL in project settings, and we should specify it in the BaseURL field as shown in the image, I would probably have to do this for every navigate step.

But I need the test cases to work for different environments, and its not practical to keep changing the BaseURL for so many tests. Is there a better solution for this scenario?

Thanks,
Niharika
0
Niharika
Top achievements
Rank 1
answered on 20 Jan 2015, 10:40 PM
I would probably be able to explain the scenario better over a call. Would it be possible to schedule a call?

Thank you,
Niharika
0
Ivaylo
Telerik team
answered on 21 Jan 2015, 03:35 PM
Hello Niharika,

I will try to find a workaround for the baseURL setting.

I will update this ticket accordingly. Thank you for your patience.

Regards,
Ivaylo
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Niharika
Top achievements
Rank 1
answered on 21 Jan 2015, 10:50 PM
Thank you Ivaylo. It would be helpful if you could maybe share a sample working solution.

Best,
Niharika
0
Niharika
Top achievements
Rank 1
answered on 24 Jan 2015, 12:06 AM
Hi Ivaylo,

I tried the data driven approach by reading the baseURL from an excel file. But even this approach doesn't work from MTM. The test doesn't execute, and fails from the data driven step.

I wasn't sure if data driven tests in Telerik is supported in MTM. Please let me know if there is any other approach to solve this issue.

Thank you,
Niharika
0
Ivaylo
Telerik team
answered on 24 Jan 2015, 08:01 AM
Hello Niharika,

I have tested this on my end, however there is no way we can plug in into the MTM's settings. This restriction is again set by MTM.

So the only workaround for your problem is to use the BaseURL in the navigate step as initially suggested.

Thank you for your understanding.

Regards,
Ivaylo
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Niharika
Top achievements
Rank 1
answered on 26 Jan 2015, 01:52 AM
Okay. Thank you.
But how about the below error?
"The test automation associated with the following test case could not be found: [1245706]. Run the test case again using a build that contains the binary with the test automation."

I get this error for a couple of random tests, that exist in the build. It is associated correctly to the test case, and even present in the .csproj file. Would you be able to assist with this?

Thanks,
Niharika
0
Ivaylo
Telerik team
answered on 28 Jan 2015, 03:00 PM
Hello,

This is still related with the deployment. Please refer to my initial reply and make sure the correct files are deployed. Test Studio is not responsible for deployment, this should be done by Visual Studio or the MTM.

Regards,
Ivaylo
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
Niharika
Top achievements
Rank 1
Answers by
Ivaylo
Telerik team
Niharika
Top achievements
Rank 1
Share this question
or