We are building a new experience for our SmartBear Community.
This site is now read-only. You can still browse and search as usual. Learn More
This site is now read-only. You can still browse and search as usual. Learn More
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
If I understood correctly, you want to convert to C#Script.
You could try this code:
function Test1()
{
var explorer = Aliases["explorer"];
var folderView = explorer["wndProgman"]["SHELLDLL_DefView"]["FolderView"];
folderView["Drag"](396, 494, 6, -3);
NameMapping["Sys"]["Keys"]("[Hold][Win]e[Release]");
var wndCabinetWClass = explorer["wndCabinetWClass"];
wndCabinetWClass["ShellTabWindowClass"]["DUIViewWndClassName"]["Explorer_Pane"]["CtrlNotifySink"]["NamespaceTreeControl"]["tvNamespaceTreeControl"]["ClickItem"]("|Desktop|This PC|MyCmd");
TestedApps["claim"]["Run"](1, true);
var java = Aliases["java"];
var panel = java["LoginDialog"]["RootPane"]["null_layeredPane"]["null_contentPane"]["Panel"];
var textField = panel["TextField"];
textField["Click"](68, 10);
textField["Keys"]("MYLOGIN");
}
I think I need to specify the objects in a library because earlier it couldn't find drag, etc?
Keep in mind, Drag is not an object, it's a method.
Again... what are you trying to do? What was posted above was converting one script to be executed within TestComplete with another script, also to be executed within TestComplete. If you are trying to convert this into C# to compile within VisualStudio, that's an ENTIRELY different thing.
Yes it is Test Complete. Using visual studio, I use Connect to connect to test complete, and then write C# code to be executed in TestComplete. So it is C# code in Visual Studio connecting to test complete.
Still new to this, so I used Test Complete recording tool to record my test. Now I have a C# method I want to take the recorded script into, and have it execute. But I can't take it verbatim.