Contributions
Re: How testcomplete works with scripts not being written inside the class?
This behavior is similar to a launching this code(e.g. in Python IDLE): def test(): print "hello world" test() but if you want to print the message in TestComplete, need to use: Log.Message("hello world")1.9KViews2likes4CommentsRe: Deleting A Folder but getting an error
May be the folderis not empty. Try to use "DeleteFolder" with two parameters aqFileSystem.DeleteFolder "C:\FolderName", True https://support.smartbear.com/testcomplete/docs/reference/program-objects/aqfilesystem/deletefolder.html?q=deleteFolder or check the path1.1KViews0likes0CommentsRe: Count characters from end of a string to front
For somecharacters: function Test() { var results = getCount("ere we ge", "e") for(result of results) Log.Message(result) } function getCount(str, char) { var startIndex = 0; var result =[]; var startPos = aqString.Find(str, char, startIndex); while(startPos != -1) { result.push(aqString.GetLength(str) - startPos - 1); startIndex = startPos + 1; startPos = aqString.Find(str, char, startIndex); } return result; }2.3KViews1like2CommentsRe: Count characters from end of a string to front
Hi You can use this code: function Test() { var str = "Hello" var startPos = aqString.Find(str, "e"); var result = aqString.GetLength(str) - startPos - 1; Log.Message(result) } or (for JavaScript) function Test() { var str = "Hello" var patt = new RegExp('e' + '.*$'); var result = aqString.GetLength(str.match(patt)) - 1 Log.Message(result); }2.3KViews1like4CommentsRe: Converting a recorded script to Connect C#
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"); }2.5KViews1like7Comments- 1.1KViews0likes1Comment