Forum Discussion

balaji0428's avatar
balaji0428
Occasional Contributor
12 years ago

How to use Test Complete With out Frameworks??

Hi All,

I'm new to this Automation tool.Can anyone please help me how to use TEST COMPLETE 9 With out Frameworks.I know We can record and play but that is not really useful to me at the moment.



The syntax are very different to QTP so i'm confused :(



I use VBscript.



Thanks in Advance

Cheers!!
  • Hi bali,



     Framework is depends on how big your project...  Compare to QTP I potentially suggest you TestComplete is the best tool.. go for Script based record and modify your script as per JSCRIPT or VBSCRIPT.   I have 2 months exp on TC..  Which language you would be choosen.





  • AlexKaras's avatar
    AlexKaras
    Champion Level 3
    Hi Bali,



    I would recommend you to visit the http://support.smartbear.com/screencasts/testcomplete/ page and spend some time watching demo recordings from there. I believe they should make a lot of things much more clear to you.



    > The syntax are very different to QTP [...]

    TestComplete uses different model, indeed. And you should spend some time to get an idea on how it works. You may start from the Test Object Model (
    http://support.smartbear.com/viewarticle/29026/) and go through the whole Getting Started Tutorial (http://support.smartbear.com/viewarticle/30932/) then.

  • Hi bali,



     Framework is depends on how big your project...  Compare to QTP I potentially suggest you TestComplete is the best tool.. go for Script based record and modify your script as per JSCRIPT or VBSCRIPT.   I have 2 months exp on TC..  Which language you would be choosen.





  • balaji0428's avatar
    balaji0428
    Occasional Contributor
    Hi Pradeep,



    I'm glad someone replied to my question Thanks for that buddy..



    I'm using VB script and working on Web based application.All i need is how to give a start??



    Thanks once again for your reply
  • balaji0428's avatar
    balaji0428
    Occasional Contributor
    Hi Alex,



    Thanks for your reply.



    I have been through those videos rather than record and play back or recording in script mode.Writing a script VB Script and reusing the script in future how that works practically i'm confused there.Because i dont have good experience with Automation all i did so far is Manuall testing so,Please help me i want to learn Automation.



    Thank you,

    Bali
  • Hi Bali,



     I understood your problem.. reusable components which you are looking for Mainly  Login page, Error handling, store log files. Those are all common every where. But specific to our project we need to create some thing while starting project.  You should have some big picture about scope of the project. I think these things will takecare by  Automation TestLead. He should aware how do we utilize tool and resualble scripts.  At the moment you just create one projecsuit.. start write Scripts under Scripts Module..

    The keep elements which you need to concentrate  when you have created a project.

    1. Store --> Useful to store files and INI files(global variables) which are called by TC

    2. Tested Apps --> To Run specific browser or all browsers at a time

    3. Script-->  write your Functions

    4.Projectsuit logs---> Create some project logs which writing Test scripts (reusable component)

    5. Keyword tests --> Just record the script in keyword manner( I belive this is for learning and verification purpose)



    The above info you will get in Tutorials..



    Let me know if you need some more info



     





  • balaji0428's avatar
    balaji0428
    Occasional Contributor
    Hi Pradeep,



    I really appreciate for your reply.



    Thats what exactly i need.And on top of it i dont have any Automation lead in my company. I am the only one working with Test Complete.I managed to do some scripting for login page and when a get a new release that Script is not working. 



    Can you please tell me how to write the script which can work even changes occured in Back-End.



    If you dont mind can you email me to balaji0428@gmail.com so that i can tell you whats my application is and what i'm trying to do.



    Thanks,

    Bali
  • Anumakonda_mahe's avatar
    Anumakonda_mahe
    Frequent Contributor
    Hi Bali,



    after recording the script you have to edit the Namemaping file and select Login page and replace the text (which there before and after Login.aspx page )with "*" simbol and save the file. now run it.  pls. check the attached document.
    • rrivest's avatar
      rrivest
      Contributor

      Best tip I could give you is to see it as standard programming... Because scripting is programming.

      Use the object browser and learn how to identify objects....

       

      Personnaly, I don't use Name Mapping because it expect the objects to be structured in specific hierarchie and I'm stuck with developers who spend their time changing that.... so instead, I seek for specific object properties of objects or components and developed a generic function that uses FindChildren and returns a null or the object itself.

       

      When automating, you're building a program that will interact with another one... decompose, build function libraries, be modular...  (standard development practices :smileywink: )

       

      Depending on the scripting language, you can even develop your automation in an Object Oriented fashion... C#, JScript do understand the "this" keyword and allowes you to encapsulate properties and methods in objects... thus, allowing lots of code reuse...

       

      Think of a screen as an object.... your script code as a unit... a Test Scenario simply steps from one screen to another and performs whatever controls you want to perform...

       

      Here's a sample of a Browser Class I've built in C# that I use instead of using TestedApp

       

      function myBrowserClass()

      {

      // Initialisation of FIELDS

      this.Component = Object(); // L'object TestComplete.Browser

      this.BrowserType = varInteger; // Le type de Browser (int, -1=IE, -2=FF, -3=Chrome)

      this.currentPage = Object(); // Object de type Page, Page courante du Browser

      this.URL = varString; // URL de la page de type String

      this.isVirtual = Boolean();

      this.Description = varString;

       

      // A method

      this.Open = function(BrowserType,isVirtual) // Instancie un fureteur selon le type

      {

       

      if (isVirtual) { // Si on utilise un Browser Virtuel

      this.isVirtual = true;

      var supported = VirtualBrowsers.Count;

      var myName = "chrome";

      if (BrowserType<supported) // Est-ce que celui demandé est supporté (Voir dans les Projets-Properties-Open App-Web Test-Virtual

      {

      var mybrowser = VirtualBrowsers.Item(BrowserType);

      Log.Message(mybrowser.UserAgent);

      }

      this.Description = mybrowser.UserAgent;

      } else { // Le fureteur est réel (IE ou autre)

      this.isVirtual = false;

      switch (BrowserType) {

      case "-1" : Log["Message"]("Fureteur demandé : " + "Microsoft Internet Explorer");

      var mybrowser = Browsers["Item"](btIExplorer);

      var myName = "iexplore";

      break;

      case "-2" : Log["Message"]("Fureteur demandé : " + "Mozilla Firefox");

      var mybrowser = Browsers["Item"](btFirefox);

      var myName = "firefox";

      break;

      case "-3" : Log["Message"]("Fureteur demandé : " + "Google Chrome");

      var mybrowser = Browsers["Item"](btChrome);

      var myName = "chrome";

      break;

      case "-6" : Log["Message"]("Fureteur demandé : " + "Edge");

      var mybrowser = Browsers["Item"](btEdge);

      var myName = "edge";

      break;

      default : Log["Message"]("Fureteur demandé : " + "Microsoft Internet Explorer");

      var mybrowser = Browsers["Item"](btIExplorer);

      }

      Log.Message("Fureteur : "+ mybrowser.Description);

      Log.Message("Family " + mybrowser.Family);

      this.Description = mybrowser.Description;

      }

      mybrowser.Run(Project["Variables"]["StartupURL"]); // La variable StartupURL se retrouve dans tous les projets.

      if (myName == 'edge')

      this.Component = Sys.Browser(myName); // Pour obtenir le processus du Browser

      else

      this.Component = Sys.Browser('*',0); // Pour obtenir le processus du Browser

      if (!this.isVirtual) { // Si le Browser n'est pas virtuel (les dimensions sont fixes pour les virtuels)

      this.Component["BrowserWindow"](0)["Maximize"]();

      }

      this.BrowserType = BrowserType;

      Log["PopLogFolder"]();

      return this.Component; // On retourne l'objet Browser

      }

       

       

      this.Navigate = function(url) // Navigue vers l'URL jusqu'à chargement complet

      {

      Log["AppendFolder"]("Navigation vers l'URL : "+url);

      var myClock = HISUtils["StopWatch"];

      myClock["Start"]();

      var myPage = this.Component["ToUrl"](url);

      while (myPage["contentDocument"] == null)

      Delay(200);

      while (myPage["contentDocument"]["readyState"] != "complete")

      myPage["Wait"]();

      Project["Variables"]["CurrentPage"]=myPage;

      myClock["Stop"]();

      //var myName = MakeLogName(Project["Variables"]["MyProject"]);

      //PushToLog(myName,"Page ; " + url + " ; "+myClock["ToString"]());

      Log["Message"](url + " ; "+myClock["ToString"]());

      this.currentPage = myPage;

      this.URL = url ;

      // this.URL = myPage["URL"];

      Log["PopLogFolder"]();

      return this.currentPage; // On retourne l'objet Page de la navigation

      }

       

       

      this.Close = function() // Ferme le fureteur

      {

      this.Component["Close"]();

      return null;

      }

       

      }

       

       

      Regards