Run one Test file from a batch file

16 posts, 0 answers
  1. S
    S avatar
    2 posts
    Member since:
    Feb 2012

    Posted 15 Jan 2013 Link to this post

    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
  2. Stoich
    Admin
    Stoich avatar
    1 posts

    Posted 15 Jan 2013 Link to this post

    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
  3. S
    S avatar
    2 posts
    Member since:
    Feb 2012

    Posted 17 Jan 2013 Link to this post

    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.

  4. Alan
    Alan avatar
    6 posts
    Member since:
    Aug 2011

    Posted 21 Jan 2013 Link to this post

    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"
  5. Stoich
    Admin
    Stoich avatar
    1 posts

    Posted 22 Jan 2013 Link to this post

    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
  6. Deepeka
    Deepeka avatar
    1 posts
    Member since:
    Aug 2012

    Posted 18 Apr 2013 Link to this post

    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









  7. Alan
    Alan avatar
    6 posts
    Member since:
    Aug 2011

    Posted 18 Apr 2013 Link to this post

    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.
  8. Deepeka
    Deepeka avatar
    1 posts
    Member since:
    Aug 2012

    Posted 18 Apr 2013 Link to this post

    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
  9. Alan
    Alan avatar
    6 posts
    Member since:
    Aug 2011

    Posted 18 Apr 2013 Link to this post

    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
  10. Boyan Boev
    Admin
    Boyan Boev avatar
    1039 posts

    Posted 23 Apr 2013 Link to this post

    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
  11. Deepeka
    Deepeka avatar
    1 posts
    Member since:
    Aug 2012

    Posted 23 Apr 2013 Link to this post

    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



  12. Boyan Boev
    Admin
    Boyan Boev avatar
    1039 posts

    Posted 25 Apr 2013 Link to this post

    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
  13. Deepeka
    Deepeka avatar
    1 posts
    Member since:
    Aug 2012

    Posted 30 May 2013 Link to this post

    Thank you so much.
    xml file solved my purpose !!:):)
  14. Boyan Boev
    Admin
    Boyan Boev avatar
    1039 posts

    Posted 31 May 2013 Link to this post

    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!
  15. rob
    rob avatar
    1 posts
    Member since:
    Feb 2016

    Posted 16 Feb in reply to Boyan Boev Link to this post

    thanks for the config file, they should put this in their documentation.
  16. Boyan Boev
    Admin
    Boyan Boev avatar
    1039 posts

    Posted 16 Feb Link to this post

    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!
Back to Top