Forum Discussion

TanyaYatskovska's avatar
TanyaYatskovska
SmartBear Alumni (Retired)
6 years ago

Day 1 - API Testing vs. UI Testing

Hello TestComplete Community,

 

I’m happy to welcome you to our API Testing vs. UI Testing competition. We aren’t going to fight. We are going to identify what it is like - “Doing UI Testing”.

Each day, we will publish a new topic to discuss. Leave your comments in topics - you and your UI Team will be rewarded.

 

Today, let’s introduce ourselves to the Community! Post a high-level description of the project you are working on.

 

Leave your comments here.

 

UI Testing Score

Track the current score and daily conversations on this page:

https://community.smartbear.com/t5/custom/page/page-id/API-Testing-vs-UI-Testing

 

Bonus Tasks

Accomplish any of the bonus tasks to earn more points:

  1. +2 points - Invite your colleague to the competition.

Mention a nickname of this person by using @ in the competition’s daily topics. You can invite as many people as you wish. NOTE: A person you invite should be a new Community member registered after the event start.

 

  1. +2 points – Make a post on social media about your participation in the competition.

Your post should contain: @SmartBear, the #APIvsUITesting hashtag and the link to your comment in the Community.

Simple tweet: API Testing vs UI testing! Which one is more important? Join me in the @SmartBear Community to talk about this: https://bit.ly/2HEZ5U4 #APIvsUITesting

 

Event Rules

  1. Leave your comments on a conversation of the day. 1 comment = 1 point to the team score.
  2. The competition will be held on March 25-29.
  3. Join the competition any day and participate in any daily conversations.
  4. Feel free to leave comments for any teams.
  5. Rewards! A team with the biggest score will win. Active participants from each team will be rewarded.

 

Let's start!

12 Replies

  • dpaulus's avatar
    dpaulus
    Occasional Contributor

    Relative UI Testing newbie here - been working with TC for about 5 months now.  Started from scratch having to learn the ins-and-outs of TC, python, and how TC integrates with our Windows application objects, etc. Since, I started out fresh, I was able to design the process however I wanted, and I believe I came up with a pretty unique design to aid in creating/updating tests faster and easier, very little maintenance, and allows anyone to create tests without first learning TC/python/etc.  I compared my design to another teams (that's been using TC for 5 years now) and if my calculations are correct, I'll be able to reduce the amount of code we have to maintain by over 95% or more.  Not sure if my design will stand the test of time yet, but I'm very happy with the way it's come out so far. :smileyhappy:

    btw...the hardest thing we've come across so far is VST's (Virtual String Trees) - in a Delphi Development environment. We did a ton a reseach (on here and other sites) trying to find a good solution. We finally figured out a way handle them, but I wouldn't say it's a great solution. If anyone has experience with VST's (especially using Python), I would definitely like to hear more about your experiences and how you figured out solutions for them.

    • Simon_InT's avatar
      Simon_InT
      Contributor

      Hi dpaulus , I'm also testing Delphi applications that use Virtual String Trees a lot and struggle with it. As of yet I have not been able to work out which Object Mapping on the project property to use in order to identify properties within the VST. When I use the object spy and select an VST object it returns the error "Error: An exception occurred: 0x0EEDFADE; class: EComponentError; description: 'TVirtualStringTree has not been registered as a COM class'" on the ComObject property. Are you able to share how you have been handling them?

      • dpaulus's avatar
        dpaulus
        Occasional Contributor

        Oh man - yeah, those are a pain.  Currently, we ended up having our developers write a little function to do the dirty work for us (see code below), and then we call the function from our TC scripts as needed.  I'm not a big fan of this method, and I did write a script that could handle it at one point, but it didn't work for every situation.  I don't think this does either, but it's a bit easier to call.  If you choose to use this, then you'd have to have your developer put it in their code (obviously, not ideal), and then call it from a debug version of the app your testing.  Regarding your error, seems like there's a possible problem there, but a general idea here is to use the Object Browser, instead of Object Spy, because it'll give you a lot more detail about all the components, not just the one you highlighted.  I almost exclusively use the Browser now when trying to lookup an object.

         

        Delphi Code:

         

        // Data can look like any of 'Value' or '[Value]' or '[Value][SubValue]' as many levels deep as needed.
        // The result they want back is |[n1]|[n2], etc.
        //   where n1 is the node index of Value,
        //         n2 is the child node index of SubValue, etc.
        //   note the pipe.  |[x] for each value returned.
        function TVirtualStringTree.GetNodeIndex(Data: String; VisibleColumnIndex: Integer): String; // for QA
        var
          Path: String;
          Column: Integer;
        
          function FindChild(aNode: PVirtualNode; aData: String): PVirtualNode;
          var
            Node: PVirtualNode;
            Idx: Integer;
          begin
            Result := nil;
            idx := -1;
        
            if aNode = nil then
              Node := GetFirst
            else
              Node := aNode.FirstChild;
        
            While Node <> nil do
            begin
              idx := idx + 1;
              if Text[Node, Column] = aData then
              begin
                Path := Path + '|[' + IntToStr(idx) + ']';
                Result := Node;
                break;
              end;
              Node := Node.NextSibling;
            end;
          end;
        
        var
          lData: String;
          Node: PVirtualNode;
          aTS: TStringList;
          ColumnsArray: TColumnsArray;
        begin
          if Data <> '' then
          begin
            aTS := TStringList.Create;
            try
              ColumnsArray := Header.Columns.GetVisibleColumns;
              Column := ColumnsArray[VisibleColumnIndex].Position;
              Path := '';
        
              lData := Data;
              if lData[1] = '[' then
                lData := Copy(lData, 2, MAXINT);
              if lData[Length(lData)] = ']' then
                lData := Copy(lData, 1, Length(lData) - 1);
        
              aTS.Text := Trim(StringReplace(lData, '][', #13#10, [rfReplaceAll]));
        
              Node := FindChild(nil, aTS[0]);
              aTS.Delete(0);
              while (aTS.Count > 0) and
                    (Node <> nil) do
              begin
                Node := FindChild(Node, aTS[0]);
                aTS.Delete(0);
              end;
        
              if Node <> nil then
                Result := Path
              else
                Result := '';
        
            finally
              aTS.Free;
            end;
          end;
        end;

        Not sure what language your scripts are in, but ours is in Python, and below is how it's called...

        #-----------------------------------------------------------------------------
        # Process TVirutalStringTree
        #-----------------------------------------------------------------------------         
        def Process_TVirtualStringTree(ItemObjStr, ItemValue): 
          try:
            ColIndex = '0'  
              
            # if '>' is found, split    
            if ItemValue.find('>') != -1:       
              ColName, ItemValue = ItemValue.split('>') 
              
              # get list of column headers      
              ColumnList = ItemObjStr + ".ContentToText(3,',')"
              ColumnList = eval(ColumnList)    
              ColumnList = ColumnList.split(',')  
             
              # loop through header list until value is found, then set index                       
              index      = 0                                                            
              index2     = 0
              ColIndex   = -1   
              
              for item in ColumnList:
                index = index + 1
                item = item.strip()
                if item == ColName:
                  ColIndex = str(index2)
                  break
                index2 = index2 + 1    
              
              # if ColIndex is never updated, then the column was never found - log error  
              if ColIndex == -1:
                Log.Error('Column not found')
                
            # pass column value and column index to John's routine         
            NodeIndex = ItemObjStr + '.GetNodeIndex(' + '\'' + ItemValue + '\'' + ',' + ColIndex + ')'
            NodeIndex = eval(NodeIndex)
            
            # if john's routine returnes -1 then we log an error
            if NodeIndex == '':
              Log.Error(ItemValue + ' not found')
            
            ItemValue = NodeIndex
            
            return ItemValue
                   
          except Exception as Error:
             TerminateDueToError('Process_TVirtualStringTree', str(Error))
        

        Hope this helps.

  • Vallalarasu_P's avatar
    Vallalarasu_P
    Frequent Contributor

    Hi Community Members,

     

    I'm working for HealthCare client. Currently, working on automating web application. 

     

    Regards

    Valla

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      Same here.  Are you working on a custom application or are you automating a third party application?

  • Automating Fleet management application using warper framework over TestComplete framework

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    Hello, my name is Robert Martin and I've been using the SmartBear UI testing tool TestComplete for over 17 years in various vertical spaces including Point-Of-Sale applications, eCommerce web stores, pharmaceutical clinical trials, and healthcare patient documentation.

    Currently, I'm overseeing the test automation of a custom built web application for tracking patients who are seeking transfer from traditional hospital acute care facilities to long term acute care/rehab healthcare facilities.  This project involves a variety of automation tests to check PDF documents, database output, and general application workflows for both successful and unsuccessful referal processes.

  • baxatob's avatar
    baxatob
    Community Hero

    Hello friends!

    I am working both with UI and API testing, but my first comment for UI team, because it is my team in context of SmartBear products :)

    • Marsha_R's avatar
      Marsha_R
      Champion Level 3

      I've used TC for all sorts of testing, but my biggest project has been for a .Net (and then later web version) of enterprise software for the manufacturing industry.

  • TanyaYatskovska's avatar
    TanyaYatskovska
    SmartBear Alumni (Retired)

    Hi Guys,

     

    We have several days left for the API testing vs UI testing competition. Make sure that you participate in each daily discussion! Find all of them here:

    https://community.smartbear.com/t5/tag/APIvsUI/tg-p/board-id/Getting_Started_with_TestComplete

     

    Also, you can always get +2 points if you perform any of the bonus tasks: invite your colleague to the event or share the info on Twitter.

     

    >>Current score:

    https://community.smartbear.com/t5/custom/page/page-id/API-Testing-vs-UI-Testing