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

Run one Test file from a batch file

17 Answers 334 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
S
Top achievements
Rank 1
S asked on 15 Jan 2013, 01:32 PM
Hi Team,
I have 2 test files called as "Webtest.tstest" and "Wpftest.tstest". i want to run one test file i.e Webtest.tstest file using Batch file.

I am able to execute this test file from Command prompt using ArtOftestRunner.exe . For that i have used the below command
" ArtoftestRunner.exe Test = "C:\web\Webtest.tstest" " .
this command is not working for Batch file even when i ran from administrator rights.

please let me know as soon as possible, this is very high urgent for me.


Thanks
satyanarayana

17 Answers, 1 is accepted

Sort by
0
Stoich
Telerik team
answered on 15 Jan 2013, 04:31 PM
Hi,
try pointing to the actual location of the ArtOfTest.Runner.exe application. For instance for a x64 Win7 machine it would be something like this:
"c:\Program Files (x86)\Telerik\Test Studio\Bin\ArtOfTest.Runner.exe" test="C:\web\Webtest.tstest"

Let me know if this helps.

All the best,
Stoich
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
S
Top achievements
Rank 1
answered on 17 Jan 2013, 11:55 AM
i have used that but i am not able to execute this from a batch file but the same thing i am able to run from Command prompt.

0
Alan
Top achievements
Rank 2
answered on 21 Jan 2013, 10:31 PM
What is the error that you are receiving?  Would you consider running from a test list?  We have this functionality working.  First of all (at least for us), the batch file itself needs to be stored locally rather than executing off of a network resource.  Here is what we use to execute a test list that is stored on the network ..

cd "C:\Program Files\Telerik\Test Execution 2011.2\Bin"
ArtOfTest.Runner.exe list="\\server\share\projectfolder\TestLists\nameOfTestList.aiilist"
0
Stoich
Telerik team
answered on 22 Jan 2013, 10:16 AM
Hello guys,
@Satyanarayana - Alan has some excellent suggestions and questions and my response would have been virtually the same. Please let us know.

@Alan - thank you for jumping in the discussion, we really appreciate it. I've updated your Telerik account to give you 400 points for this contribution.

Hope to hear from you soon.

Greetings,
Stoich
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Deepeka
Top achievements
Rank 1
answered on 18 Apr 2013, 06:12 AM
Hi Team,

Even I am writing batch file to run tests from Test studio QA Edition standalone version.
Have a query can we define in batch file "under which Browser" the tests should be executed ( please share code , syntax applicable to trigger browser in test studio)

Please see below the batch commands use to execute the test lists
____________________________________________
Title TELERIK Tool
IF EXIST "C:\Program Files (x86)\Telerik\Test Studio\Bin" goto :a
echo not found
pause
exit
:a
setlocal 
path=C:\Program Files (x86)\Telerik\Test Studio\Bin;%path%
call ArtOfTest.Runner.exe list="C:\test\Edge Regression Project\TestLists\Login.aiilist" out="C:\test"
call ArtOfTest.Runner.exe list="C:\test\Edge Regression Project\TestLists\Logout.aiilist" out="C:\test"
__________________________________________________

So here before executing test lists ,I wanna specify browser settings(IE,FF) on which my tests should run

Please let me know on this as not finding any proper solution under telerik help doc.

Thanks,
D









0
Alan
Top achievements
Rank 2
answered on 18 Apr 2013, 01:53 PM
A solution that we are using successfully is to create Test Lists for each possible option and adjust the List Settings.  In your case, you would have Test Lists "Login_FireFox"; "Logout_FireFox"; "Login_InternetExplorer"; and "Logout_InternetExplorer".  The "Login_xxx" Test Lists would call the same Test File, however the settings of each Test List would identify which browser is used respectively.  Let me know if that helps.
0
Deepeka
Top achievements
Rank 1
answered on 18 Apr 2013, 02:36 PM
Thanks Alan for the reply!!

Sorry I am not clear with the comment "The "Login_xxx" Test Lists would call the same Test File, however the settings of each Test List would identify which browser is used respectively"

Does this mean that I have to create that many TestLists in test Studio as per Browser specific and already keep selected under Edit settings tab->Web->browser (IE or FF..etc)
example: Testlist name "Login_FireFox" created in Test studio have settings define as browser Firefox and in batch file just have to mention
"call ArtOfTest.Runner.exe list="C:\test\Edge Regression Project\TestLists\Login.aiilist"


But for my application already have count of 15+ TestList and in each it contains around 50+ tests ;so to create 15 TestList for FireFox then 15TestList for chrome somehow finding not proper to maintain.

Thats why looking for something which i can write in batch file by directly defining the settings/configuration done in test studio and then execute each test lists
0
Alan
Top achievements
Rank 2
answered on 18 Apr 2013, 02:57 PM
Ok, if you have 15 test lists already, my solution is not a good one.

To answer your question: example: Testlist name "Login_FireFox" created in Test studio have settings define as browser Firefox and in batch file just have to mention 
"call ArtOfTest.Runner.exe list="C:\test\Edge Regression Project\TestLists\Login.aiilist"

--> No, you would need to write it like this: "call ArtOfTestRunner.exe list="...\TestLists\Login_Firefox.aiilist".  The test list you call in your batch file needs to have the exact same name as the Test List.  You could prompt the user in your batch file if they wanted to run FF or IE or etc, and then based on the user input, you would call only the list the user desired.

I will attempt a better solution...instead of using 15 Test Lists, my solution would work if you had 1 or 2 Test Lists.  In order to do that, create a separate Test File (a Driver Script) that calls each of the tests you wish to execute.  Then create a Test List that calls your Driver script.  See my screenshot for assistance and let me know if this makes sense.

Thanks!
Alan
0
Boyan Boev
Telerik team
answered on 23 Apr 2013, 07:22 AM
Hello guys,

@Deepeka -  Alan pointed you to the right direction. Let me know if you need additional assistance.

@Alan - Again thank you for jumping in the discussion, we really appreciate it!

Regards,
Boyan Boev
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Deepeka
Top achievements
Rank 1
answered on 23 Apr 2013, 02:40 PM
Hi Alan and Boyon,

Sorry , i am not clear with concept of using the Driver script ; does it mean to create a Tests and write customise code and call each tests.
But i am not sure how it will work in my case.

Currently we have 300+ Tests written for our application so all need to be run on IE and FF
 i.e 1 Test list = 50+ test case ; ex: Orders test list = 50 test cases 

I do not not want all my 300+ test cases run at one go so i have created test list for each set and writing batch to call them one after the other.

part of sample code providing below how I am calling each "test list" which will by default run on IE-

echo Calling Login test list
call ArtOfTest.Runner.exe list="C:\Edge Regression Project\TestLists\Login.aiilist" out="C:\Andrei\"
echo  ####Login test list execution completed####
echo Calling Logout test list
call ArtOfTest.Runner.exe list="C:\\Edge Regression Project\TestLists\Logout.aiilist" out="C:\Andrei"
echo  ####Logout test list execution completed####
echo Calling Prioirty1_Orders test list
call ArtOfTest.Runner.exe list="C:\Edge Regression Project\TestLists\Prioirty1_Orders.aiilist" out="C:\Andrei"


So please let me know or provide me sample code for driver script test file which need to be written which can help me to execute all my 300 tests under IE then FF .
Main issue is of how to define Webbrowser in batch file under which the tests will be executed.


Thanks,
D



0
Boyan Boev
Telerik team
answered on 25 Apr 2013, 02:44 PM
Hi Deepeka,

To define browser you need to create a custom config (xml) file and specify it in the batch file as ArtOfTest.Runner argument (settings=[path file]).

I am attaching a sample config file which defines FireFox as a default browser.

So your batch file should looks like:

echo Calling Login test list
call ArtOfTest.Runner.exe list="C:\Edge Regression Project\TestLists\Login.aiilist" out="C:\Andrei\" settings="c:\myFolder\config.xml"
echo  ####Login test list execution completed####

Hope this helps.
 

All the best,
Boyan Boev
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
0
Deepeka
Top achievements
Rank 1
answered on 30 May 2013, 10:53 AM
Thank you so much.
xml file solved my purpose !!:):)
0
Boyan Boev
Telerik team
answered on 31 May 2013, 08:07 AM
Hello Deepeka,

Great! I am glad to hear that this issue is resolved. 

Please don't hesitate if you have additional questions.
 

Regards,
Boyan Boev
Telerik
Free summer webinars on advanced web automation tactics hosted by Jim Holmes & Adam Goucher.
Reserve your seat today!
0
rob
Top achievements
Rank 1
answered on 16 Feb 2016, 12:15 PM
thanks for the config file, they should put this in their documentation.
0
Boyan Boev
Telerik team
answered on 16 Feb 2016, 02:29 PM
Hi Rob,

We have a config file example in that article.

Let us know if you need further assistance.

Regards,
Boyan Boev
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Nikhil
Top achievements
Rank 1
answered on 03 Feb 2017, 04:33 PM

Hello
I have created a custom config xml file and specified default browser as "Chrome" or "FireFox" and am trying to execute a batch file as ArtOfTest.Runner(settings = xml file). When I execute the batch file, test scripts are always run in "InternetExplorer" and not the one that I have specified as default Browser. So, can anyone help me out here? My objective is to run the testscripts in any browser that I specify in xml file.

 

Thanks

Nikhil

0
Nikolay Petrov
Telerik team
answered on 08 Feb 2017, 10:12 AM
Hi Nikhil,

Please, make sure that the xml settings file is properly created. If it is not - the would be exception in the application log and default values would be considered.

Refer to this article for proper xml settings file structure.

Regards,
Nikolay Petrov
Telerik by Progress
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
S
Top achievements
Rank 1
Answers by
Stoich
Telerik team
S
Top achievements
Rank 1
Alan
Top achievements
Rank 2
Deepeka
Top achievements
Rank 1
Boyan Boev
Telerik team
rob
Top achievements
Rank 1
Nikhil
Top achievements
Rank 1
Nikolay Petrov
Telerik team
Share this question
or