Converting a recorded script to Connect C#
Hello
I successfully recorded (as a script) and played back my test. I have a small part of the script below. Not sure what language the script is in.
I have to convert this to C# using Connect. Not sure how to do that. As I suspected, I can't just copy verbatim. Wondering whether you could help me with a small part of the test. Then maybe I can figure out how to do all of it. Rest sassured each variable is declared as "var" in the script. I just did not copy the var decs. So does anyone have some tips as how to convert to C#? This is Windows 10 / TC 12, VS 2012.
here is a sample. I know I can do a Connect.Aliases["explorer'] I guess, but then am stuck:
explorer = Aliases.explorer;
folderView = explorer.wndProgman.SHELLDLL_DefView.FolderView;
folderView.Drag(396, 494, 6, -3);
NameMapping.Sys.Keys("[Hold][Win]e[Release]");
wndCabinetWClass = explorer.wndCabinetWClass;
wndCabinetWClass.ShellTabWindowClass.DUIViewWndClassName.Explorer_Pane.CtrlNotifySink.NamespaceTreeControl.tvNamespaceTreeControl.ClickItem("|Desktop|This PC|MyCmd");
TestedApps.claim.Run(1, true);
java = Aliases.java;
panel = java.LoginDialog.RootPane.null_layeredPane.null_contentPane.Panel;
textField = panel.TextField;
textField.Click(68, 10);
textField.Keys("MYLOGIN");
Right... it doesn't work quite that way. You can't just run straight C# code in TestComplete. TestComplete has a C#Script that is more of an adaptation of JScript. So, if you want to run a records script from VisualStudio, you should look into this.
https://support.smartbear.com/testcomplete/docs/working-with/integration/ms-vs/alm/run-from-vs.html?q=run%20test%20visual%20studio