New to Telerik Test Studio? Download free 30-day trial

Compilation Exceptions when Executing Remotely

PROBLEM

My test list executes exception free when it is executed from the project location. If I schedule it to be executed remotely there are compilation exceptions in the execution log similar to this one:

Compile failed: c:\Users\someuser\AppData\Local\Temp\8\Projects\2fa80212-43cb-4b99-882c-e69f4d1936d2\TestRemoteElemMissing\RunTest.tstest.cs(53,19) : error CS1061: 'TestRemoteElemMissing.Pages' does not contain a definition for 'Google' and no extension method 'Google' accepting a first argument of type 'TestRemoteElemMissing.Pages' could be found (are you missing a using directive or an assembly reference?)

Such behavior could appear if executing a test list scheduled or remotely. By design when a test list is being run remotely/scheduled only tests listed for execution in the current list are deployed on the execution machines. While maintaining the project and creating tests elements will be recorded in tests (please see Test 1 on the image below to illustrate the example).

Defined Element

Though the same element could be reached from another test for example - in a RunTest coded step (on the image below).

Used in Different Test

When locally executed on the machine which hosts the project there will be no compilation errors since the complete project is available and compiled from its root folder prior execution. Though if only the test RunTest is placed in a test list for remote/scheduled execution the given above compilation exception would occur.

SOLUTION 1

To refer an element trough the Pages file is not a recommended practice as you could face similar difficulties. An approach to avoid the above described issue could be to identify the element in code using the identifications methods supported in Progress Testing Framework and insert actions against it. An example of this solution could be seen below:

Different Logic

SOLUTION 2

If the test project is in a TFS source controlled environment when run remotely/schedule the test list (Step 2) there is an option - "Get latest version of tests automatically from TFS". Once this option is enabled the entire project would be downloaded on the remote machine and compiled there exception free.

In this article