Mia
11 years agoContributor
Record&Playback versus creating scripts manually: What is better?
Hi,
I have a little experience with creating testing scripts manually with some conventions of mapping and naming objects and I also created a few test scripts using TestComplete Record Script functionality. I've been trying the compare whether it's better to do it myself or let TestComplete generate script which is really hard to read and to edit. Of course, creating those scripts manually is definitely more time consuming but on the other hand, easily editable, easily readable...
I'd rather use the Record script functionality with some modifying after (there are a lot of things that cannot be tested without writing some special methods), because it is faster and it works pretty reliably with WPF. But here's the thing with the editaion of such unreadable code which Test Complete generates (see below).
Aliases.My_Client.FerdaMain.MdiClient.TechnologyOverview.host.HwndSource_AdornerDecorator.AdornerDecorator.AvalonAdapter.TechnologyOverviewView.MainGrid.MyDock.MyDockPanel.ScrollViewer.SwimContainer.Border.SwimLine.Grid.ItemsListBox.ListBoxItem2.Border.Grid.ButtonDegree.ClickButton();
Aliases.My_Client.Dimension_Map.host.HwndSource_AdornerDecorator.AdornerDecorator.AvalonAdapter.DimensionMapView.Grid.MainGrid.GroupedDataGrid.GroupItem.DataGridRow.DataGridCell3.ContentPresenter.ComboBox.ClickItem(1);
Aliases.My_Client.Dimension_Map.host.HwndSource_AdornerDecorator.AdornerDecorator.AvalonAdapter.DimensionMapView.Grid.MainGrid.GroupedDataGrid.GroupItem.DataGridRow.DataGridCell4.ContentPresenter.Grid.Grid.Button.ClickButton();
My first question is, if you have some way to make the generated code more readable (I know that I can order TestComplete to generate the variables, but sorry - that's much worse in case of our application. I was thinking about creating an easy application which clears the code and puts the recurrent parts into variables. I was also thinking about using Keyword tests instead, but I need to use my own functions to control our application, so it's not suitable for me.
But I wonder if there is some another way?
And my second question is, should I rather consider creating the scripts on my own even if it takes longer to create the tests? Is there anyone who uses Record and Playback tests for application which is constantly beeing developed. I simply do not know how to keep the awful generated code fresh.
I have a little experience with creating testing scripts manually with some conventions of mapping and naming objects and I also created a few test scripts using TestComplete Record Script functionality. I've been trying the compare whether it's better to do it myself or let TestComplete generate script which is really hard to read and to edit. Of course, creating those scripts manually is definitely more time consuming but on the other hand, easily editable, easily readable...
I'd rather use the Record script functionality with some modifying after (there are a lot of things that cannot be tested without writing some special methods), because it is faster and it works pretty reliably with WPF. But here's the thing with the editaion of such unreadable code which Test Complete generates (see below).
Aliases.My_Client.FerdaMain.MdiClient.TechnologyOverview.host.HwndSource_AdornerDecorator.AdornerDecorator.AvalonAdapter.TechnologyOverviewView.MainGrid.MyDock.MyDockPanel.ScrollViewer.SwimContainer.Border.SwimLine.Grid.ItemsListBox.ListBoxItem2.Border.Grid.ButtonDegree.ClickButton();
Aliases.My_Client.Dimension_Map.host.HwndSource_AdornerDecorator.AdornerDecorator.AvalonAdapter.DimensionMapView.Grid.MainGrid.GroupedDataGrid.GroupItem.DataGridRow.DataGridCell3.ContentPresenter.ComboBox.ClickItem(1);
Aliases.My_Client.Dimension_Map.host.HwndSource_AdornerDecorator.AdornerDecorator.AvalonAdapter.DimensionMapView.Grid.MainGrid.GroupedDataGrid.GroupItem.DataGridRow.DataGridCell4.ContentPresenter.Grid.Grid.Button.ClickButton();
My first question is, if you have some way to make the generated code more readable (I know that I can order TestComplete to generate the variables, but sorry - that's much worse in case of our application. I was thinking about creating an easy application which clears the code and puts the recurrent parts into variables. I was also thinking about using Keyword tests instead, but I need to use my own functions to control our application, so it's not suitable for me.
But I wonder if there is some another way?
And my second question is, should I rather consider creating the scripts on my own even if it takes longer to create the tests? Is there anyone who uses Record and Playback tests for application which is constantly beeing developed. I simply do not know how to keep the awful generated code fresh.