Ask a Question

Recording in C# script possible?

jloyzagawh
Contributor

Recording in C# script possible?

I am recording a script and I've changed the native language to C# script yet when it records it gives me this code - how can I get it to convert/record in C# script?

function Test1()
{
var hwndSource;
var tabControl;
var grid;
var grid2;
var masterSearchPanel;
var listBox;
var itemsControl;
var searchTab;
TestedApps.SportingBet_Intrabet.Run();
hwndSource = Aliases.SportingBet_Intrabet.HwndSource_IntrabetMainWindow;
tabControl = hwndSource.IntrabetMainWindow.Grid.Grid.windows;
tabControl.ClickTab("Event Management");
grid = tabControl.eventManagement.grdMain;
grid2 = grid.EventStack.Grid.Grid.Grid;
masterSearchPanel = grid2.masterSearchPanel;
masterSearchPanel.Grid.lbSearchResults.ClickItem(3);
listBox = grid2.Grid.CurrentSearchPanel.Grid.Grid.lbSearchResults;
listBox.ListBoxItem4.EventSearchResultView.Click(388, 8);
listBox.ListBoxItem2.EventSearchResultView.Click(402, 12);
grid.Grid.tabControl.ScrollViewer.Grid.contentEventSummary.Grid.Grid.StackPanel.pnlLinks.ItemscontrolLinks.ContentPresenter.Button.ClickButton();
itemsControl = grid2.lbFurtherSearches;
searchTab = itemsControl.ContentPresenter2.Grid.searchTab;
searchTab.Click(10, 91);
searchTab.Click(24, 60);
itemsControl.ContentPresenter.Grid.searchTab.Click(21, 75);
masterSearchPanel.Click(19, 46);
tabControl.ClickTab("Dashboard");
hwndSource.Close();
}

4 REPLIES 4
leandropoblet
Frequent Contributor

Re: Recording in C# script possible?

Have you tried creating a new project this time using C# as default script language and then recording?

Does it come with the same output?

DWalsh
Moderator

Re: Recording in C# script possible?

You could also change the default to C~Script in Tools >Options >General >Project and then record your script.

 

Regards

Damien

cunderw
Community Hero

Re: Recording in C# script possible?

If you created the project with Jscript you will not be able to just change the default and have it work in that project. You will have to create a new project with C# as it's language. 


Thanks,
Carson

Click the Accept as Solution button if my answer has helped
TanyaYatskovska
Community Manager

Re: Recording in C# script possible?

My 2 cents J

Jloyzagawh, you need to create a C# project. In this case, TestCompete will record scripts by using this script language. If you have already recorded many scripts with JScript, there is no need to re-record them. C#Script and JScript languages use the same engine. Thus, C# projects can execute JScript tests.

 

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
cancel
Showing results for 
Search instead for 
Did you mean: