Contributions
Converting Number to Matching Character 1=A, 2=B, 3=C....
I have a function that returns the data from a column in an Excel file - now I want to return the data for a row. Below is the function that returns the column - in this case column = D and starting at row 2 and ending at row 50. I would like to convert this to return a row but have to arguments be ("C:\\Users\\TEST.xlsx", "STEP", 5, 3, 15) so this will return the data in row 5 starting at column C and ending at O. I'm not able to find a build in function to convert the alphaNumber to the matching letter in the alphabet. I could use thearguments ("C:\\Users\\TEST.xlsx", "STEP", 5, "C", "O") but I also don't see a next to move from C to D to E to F and so on. Any pointers would be of great help. Thank you, BMD function RUNgetExcelColumnCSE() { Get = getExcelColumnCSE("C:\\Users\\TEST.xlsx", "STEP", "D", 2, 50); Log.Message("Get = "+(Get)); } function getExcelColumnCSE(FilePathName, SheetName, sCol, iStart, iEnd) { if (iStart < iEnd) { sCol = aqString.ToUpper(sCol); /*Convert the column character to UPPER regardless of argument*/ var iR = iStart; /*Set a row counter equal to the starting row*/ var ColumnText = ""; var excelFile = Excel.Open(FilePathName); var excelSheet = excelFile.SheetByTitle(SheetName); while (iR < iEnd) { var Found = excelSheet.Cell(sCol, iR).Value; if (Found == undefined) { /*Do Nothing*/ } else { if (aqString.GetLength(ColumnText) == 0) { ColumnText = (Found); } /*Frist value will not add a , first*/ else { ColumnText = (ColumnText)+","+(Found); } /*Adding a , and then the value found to the string*/ } iR++; } if (aqString.GetLength(ColumnText) == 0) { return ("Nothing Found To Return"); } else { return (ColumnText); } } else { Log.Message("The Start row value "+(iStart)+" is grater then the End row value "+(iEnd)); } }460Views0likes2CommentsUser Forms Reset Button
Team, I have a user form that has 8 to 10 input fields. I have them prefilled with 'my' default values. My questions is - is there a way to 'reset' or 'clear' the default values on the user form and allow the script to continue after the tester clicks the 'reset/clear' button and enters the new values. I have the 'mrOK' labeled as continue as that is what happens but I would like a 'reset/clear' button to remove the default values from the user form. Any Pointers, Thank You, BMD349Views0likes1CommentRe: Comparing part of a .pdf with a Store.Region
So can you region a small part of any .pdf that you have on your network and save that small part in TC as a store, and script (we use JavaScript) opening the same .pdf and comparing the small part of the .pdf that is in the TC store to the opened full .pdf document and get a pass? Then open a different .pdf and get a failure? This is my objective and what I can't seems to get to work. I did this instead. var ManualResults = UserForms.ManualStarsLogoImageCheck.ShowModal(); if ( ManualResults == 6 ) /*Success */ { Log.Message("AR9 meets ER9 'PASS' - The PDF will have a title of 'Checklist'"); ProjectSuite.Variables.ARcount++; } else if ( ManualResults == 2 ) /*View Log */ { Log.Warning("AR9 COULD meet ER9 'WARNING' – Unable top verify that the PDF HAD a title of 'Checklist'"); ProjectSuite.Variables.ERRORcount++; } else if ( ManualResults == 7 ) /*Failure */ { Log.Error("AR9 did NOT meet ER9 'FAILED' - The PDF DID NOT have a title of 'Checklist'"); ProjectSuite.Variables.ERRORcount++; } else { Log.Error("The ManualResults value was not set by the UserForms.ManualReportImageCheck.ShowModal."); } Thank you, BMD1.2KViews0likes2CommentsComparing part of a .pdf with a Store.Region
Team, I have a Store.Region of an image of a .pdf that looks like: and I have a generated .pdf from my web application that looks like: I'm trying to verify that the Logo is found on the .pdf and have tried all different kinds of: With FindRegion is the StarsLogo found in the Sys.Process("Acrobat") LogoFound2 = Regions.FindRegion(Regions.StarsLogo, Sys.Process("Acrobat")); - returned "Cannot get a picture object from the input parameter." I took a second image of the logo just to see if TC could compare two Store.Regions Pict3 = Regions.StarsLogo2; LogoFound1 = Regions.StarsLogo.Check(Pict3, false, false, 1, 1); - returned "The region checkpoint "StarsLogo" failed. See Details for additional information." and Details is "Cannot get a picture object from the input parameter.". I'm beginning to believe that TC can't actually do a compare of two images even if they are the same. At least TC can't compare a stored image to any part of an opened adobe .pdf. Any pointers (even wrong ones) to help me find the solution are welcome. Thank you, BMD1.3KViews0likes5CommentsRe: SetText over Keys for speed
Maybe this will help. The code below ONLY enters 'Keys input'. The 4000+ long string and 'SetText input' is NOT entered. The object is found as the .Click and the .Keys work just fine. var PropNames = ["Name", "idStr", "VisibleOnScreen"]; var PropValues = ["Textarea(\"Comments\")", "Comments", true]; var Comments_TB = Sys.Browser(ProjectSuite.Variables.Browser).Find(PropNames,PropValues,20); if ( Comments_TB.Exists ) { Comments_TB.Click(); Comments_TB.Keys("^a[Del]Keys input"); Comments_TB.SetText(TheString); Comments_TB.SetText("SetText input"); }1.4KViews0likes1CommentRe: SetText over Keys for speed
This is exactly what I am doing with the .Keys() function. It takes too long to type the 4000+ characters into the field. It types the characters in about 8 times in the comment field on different pages. The script runs fine but takes about 45 minutes to complete. I'm looking for ways to refactor the code and speed up the script. I thought my description about changing from the .Keys to the .SetText function would explain that. I have use the .Keys and is working but I'm looking to speed the script up by switching to the .SetText function. Thanks anyway, BMD1.4KViews0likes3CommentsSetText over Keys for speed
Below is a bit of code that types over 4000 characters into the comment field. I changed the keys to SetText because it takes too long to type the charterers in to the field. The SetText I thought would be faster but it does not work at all. This is using Firefox version 68.5 as the browser and TC is version 14.30. Any pointers are greatly appreciated. Thank you, BMD TheString = LOCALBuildThe4000LongString(); var PropNames = ["Name", "idStr", "Visible"]; var PropValues = ["Textarea(\"Comments\")", "Comments", true]; var Comments_TB = Sys.Browser(ProjectSuite.Variables.Browser).Find(PropNames,PropValues,20); if ( Comments_TB.Exists == true ) { Comments_TB.Click(); Comments_TB.SetText(TheString); } function LOCALBuildThe4000LongString() { var String1 = "Web testing Automated. "; var String = ""; for (var i=1; i<200; i++) { String = aqString.Concat(String, String1); } return String; }Solved1.5KViews0likes6CommentsRe: Windows 10, Edge, and the currentStyle in the object spy.
Although you are partly correct the underlying problem is using object spy of the report button and clicking on currentStyle (the object in the properties tree) the tabs properties and methods is missing the fields tab and the tabs listed have to returned values.1.9KViews0likes0Comments