Contributions
How to do FTP operations in test complete?
Is there a TestComplete library to do FTP operations in test script using JScript/Java script? Currently I am invoking WinSCP shell command script but with that I have to use static wait times which fail often since test complete has no control of it.803Views0likes1CommentRe: aqFile LinesCount fails to work
Thanks for your reply. when I use the FS object as in below function it reads the lines and I am able to count the lines in count variable. function ReadFile(AFileName) { const ForReading = 1; let FS = Sys.OleObject("Scripting.FileSystemObject"); let F = FS.OpenTextFile(AFileName, ForReading); count =0; while(! F.AtEndOfStream){ let s = F.ReadLine(); count++; } F.Close(); }2.3KViews0likes2CommentsaqFile LinesCount fails to work
here is my function where I am using LinesCount and facing issue, language used is JScript function getLines(){ var sapFile; sapFile = aqFile.OpenTextFile("PHOENIX_ACTUALS", aqFile.faRead, aqFile.ctANSI); sapFile.SetPosition(0, 0); Log.Message(sapFile.LinesCount); sapFile.Close(); } The PHOENIX_ACTUALS is a text file and has211 lines,LinesCount is returning 1 instead.Solved2.3KViews0likes8CommentsHow to create java Arrays in TestComplete?
I amtrying to use this java classhttp://wush.net/svn/mindprod/com/mindprod/csv/CSVSort.java in my test automation to sort a csv file. I am using JScript as my scripting lang. Here is the info about the parameters of the constructor of this class * Param fileBeingProcessed CSV file to be packed to remove excess space and quotes. * Param sortCols array of 0-based cols to sort on. * Param sortTypes array of chars with letters s i n x to tell how to sort each column. * Param isAscendings array of sort direction, true=ascending, false = descending. * Param separatorChar field separator character, usually ',' in North America, * ';' in Europe and sometimes '\t' for * tab. * Param quoteChar char to use to enclose fields containing a separator, usually '\"'. Use (char)0 if * you don't want a quote character. * Param commentChar char to use to introduce comments. Use (char) 0 if none. Only one character allowed. * Param encoding encoding for input and output. * * @throws java.io.IOException if problems reading/writing file */ /* CSVSort( final File fileBeingProcessed, final int[] sortCols, final char[] sortTypes, final boolean[] isAscendings, final char separatorChar, final char quoteChar, final char commentChar, final Charset encoding ) */ here is how I am calling it function sortCSV(){ csvPath = Project.path + "\\test data\\SendToSAP\\csvFile.csv" // this line gives me the java worker process var jwp = getJwpProc(); //create a Java File var file = jwp.JavaRuntime().JavaClasses.java_io.File.newInstance(csvPath); //create a charset var charset = jwp.JavaRuntime().JavaClasses.java_nio_charset.Charset.forName("UTF-8"); var arrCols = new Array(31,35); var arrChars = new Array('i','i'); var arrBool = new Array(aqConvert.VarToBool("true"),aqConvert.VarToBool("true")); CSVSort = JavaClasses.com_mindprod_csv.CSVSort.newInstance(file,arrCols,arrChars,arrBool,',','\"','#', charset); Log.Message("done"); } when I run it, it gives me error with msg "invalid procedure or argument" I think I need to pass Java Arrays to the function instead of Jscript array, not sure what the syntax would be for that. any help is greatly appreciated.Solved2.2KViews1like2Comments