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

Compilation error when running a test script

2 Answers 199 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mindy
Top achievements
Rank 1
Mindy asked on 22 Aug 2012, 01:34 PM
Hi,

I'm having a problem with compilation error in a test script, but it ran fine if I opened that same script and run it.  

We're running stand-alone Test studio and we use store our automation tests in TFS.  There are 2 of us creating/editing automation tests, but we don't touch each other scripts.  Therefore, we only check in our own test scripts and use the "Get latest" option. 

After I did a get latest option, I tried to run my script "Message"; I got a compilation error on other scripts.  For example, "Search" script (please see the screen shot for the log error).  I went and run the "Search" script, it ran without any error.

The "Sort and Filter Cases" was created and it didn't work so the other Tester deleted all the steps in that script; so it's blank.  I opened the script and verified that there is no step in it. 

Could you help me figuring out why I am having these complilation problem?  Right now, I can't run my script due to this compilation error.

Thanks,
Mindy

2 Answers, 1 is accepted

Sort by
0
Mindy
Top achievements
Rank 1
answered on 22 Aug 2012, 05:24 PM
As a work around, I deleted the "Search" script from my local drive.  I am now able to run my script w/o a problem. 

Two questions:
    What do I need to do if I want to add that script back in the future?
    What is the best practice for check in and get latest with TFS server when two Users using the same project?

The other Tester and I were running into problem a few months ago; when we selected the root of the project to do check in and get latest.  We would get a merge window and accepted the default merge.  And some of my scripts that were running before checking in wouldn't run any more due to missing files.  They were just testing scripts, so I deleted them.

Since we create different scripts and don't edit each other scripts.  We decided to check in at the script level, because we know exactly which scripts we worked on.  Then "get latest" at the root of the project.

It worked for awhile, but then we got the merge window again; so we would cancel the merge.  Go to TFS and get latest and take the server version when there are conflicts. 

Thanks,
Mindy
0
Stoich
Telerik team
answered on 27 Aug 2012, 05:14 PM
Hello Mindy,
I'm sorry to hear you're experiencing this issues.

Test Studio has a few quirks that when it comes to coded step. You'll need to be aware of them in order to avoid similar problems in the future.

A) Compilation errors can by thrown by other tests in your project - not the one you're trying to work on. If your colleague's tests are contained within the same test project - you might be getting compilation errors from his tests.

B) Attempting to run a test will compile the entire project but only if the test contains coded steps. This is related to A). If your test doesn't contain coded steps - you will be able to run it independently of the rest of the test project, no problem. If it does contain coded steps - it will compile the entire test project. This might bring up compilation errors from other tests in the project (that might have been ignored otherwise).

C) Coded segments can remain in your test even if you're removed all the coded steps from the test. To make absolutely sure you've removed everything that might be causing a compilation error - use the Remove Script File button (screenshot 1). It will also be available if you're removed all coded steps but there's still a code behind file associated with your test.

Regards,
Stoich
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
Mindy
Top achievements
Rank 1
Answers by
Mindy
Top achievements
Rank 1
Stoich
Telerik team
Share this question
or