Exporting variable to CVS file to use in a later test
Hi All. I am generating a variable in Test1, that I would like to write/output to a CSV file (or even Excel would work) for use in Test2. Does anyone know of an easy way to do this? Or can provide some information on where to look on how to write to specific fields in a CSV/Excel file? Thanks.Solved1.2KViews0likes3CommentsNew Excel Object in 14.5 - please add additional features to new Excel object similar to COM object
New Excel Object in 14.5 - please add additional features like '.RefreshAll', '.Application.Calculate', '.Application.CalculateFullRebuild' just like the Excel.application COM Object features. Though the new Excel object provides options to update the specified cell values, the other dependent cells that are having references to the parent cell are not getting updated automatically. For ex: Sheet1.Cell(A1) value is <Login URL> We are referencing this Sheet1.Cell value in other sheets having test cases as parameters like as follows: Sheet2.Cell(A1) having formula "=CONCATENATE(Sheet1!$A$1,"/page1")" Sheet3.Cell(A1) having formula "=CONCATENATE(Sheet1!$A$1,"/page2")" Currently we are using the'.RefreshAll', '.Application.Calculate', '.Application.CalculateFullRebuild' features of Excel.application Com object feature to refresh/update the excel files for this requirement. All the referenced cells are automatically updated. If this features are available in new Excel object then we can completely do away with Excel installation in Test Execution machines.1KViews6likes0CommentsTrying to process data from an Excel file
I'm trying to process the rows in an Excel file. Is there a way to do that by just reading in the worksheet once and then iterate through the rows.?? Each row will cause the flow of the test case to be conditionally changed as the required test steps for the active row is run depending on the values in different columns of the row.Solved1.4KViews0likes3CommentsUsing Excel file as input to Soap call. Date issue uses slash separation.
Hi I'm trying to call a soap method where one of the inputs is a date. All the other input work fine. The date-format inthe excel sheet is DD-MM-YYYY but when SoapUI Pro reads it, it comes out as DD/MM/YYYY. I.e. it is separated by slashes instead of hyphens. Now the request does not adhere to the xsd schema and hence I cannot send it. So the question is how do I change the date format of the input in SoapUI? Thanks in advance.Solved2.1KViews0likes4CommentsHandling POIXML Exception in Groovy Scripting
We are trying to read data from xlsx file using apache POI, we have all the jars files placed under soap/bin/ext. It gives us below error when running our groovy script. org.apache.poi.ooxml.POIXMLException: org.apache.xmlbeans.XmlOptions.setEntityExpansionLimit(I)Lorg/apache/xmlbeans/XmlOptions; error at line: 15 Code: import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.ss.usermodel.WorkbookFactory; import org.apache.poi.ss.usermodel.CellStyle; FileInputStream inputStream = new FileInputStream("D:\\SOAP\\ExcelPOI.xlsx") Workbook wb = WorkbookFactory.create(inputStream) Sheet sheet1 = wb.getSheet("Sheet Name") int rows = sheet1.getLastRowNum(); log.info(rows)2.5KViews0likes11CommentsCan't import/upload .XLSX/.XLS files in Swagger (ASP NET Core)
Hello guys, it's my first post here and I'm glad to be part of this community. So, I've an ASP NET Core Web API that uses Swagger, and one of the methods must import an IFormFile as an Excel (.xlsx or .xls). I've already added the corresponding MIME Types on my FileUploadOperation.cs but when I hit the Swagger button do execute the action after choose a .xlsx file, the field becomes red and I can't import the file. The code above is my FileUploadOperation.cs: public class FileUploadOperation : IOperationFilter { private const string formDataMimeType = "multipart/form-data"; private const string formDataMimeType2 = "application/vnd.ms-excel"; private const string formDataMimeType3 = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"; private static readonly string[] formFilePropertyNames = typeof(IFormFile).GetTypeInfo().DeclaredProperties.Select(p => p.Name).ToArray(); public void Apply(Operation operation, OperationFilterContext context) { var parameters = operation.Parameters; if (parameters == null || parameters.Count == 0) return; var formFileParameterNames = new List<string>(); var formFileSubParameterNames = new List<string>(); foreach (var actionParameter in context.ApiDescription.ActionDescriptor.Parameters) { var properties = actionParameter.ParameterType.GetProperties() .Where(p => p.PropertyType == typeof(IFormFile)) .Select(p => p.Name) .ToArray(); if (properties.Length != 0) { formFileParameterNames.AddRange(properties); formFileSubParameterNames.AddRange(properties); continue; } if (actionParameter.ParameterType != typeof(IFormFile)) continue; formFileParameterNames.Add(actionParameter.Name); } if (!formFileParameterNames.Any()) return; var consumes = operation.Consumes; consumes.Clear(); consumes.Add(formDataMimeType); if (operation.OperationId.Equals("PostProcessBatch")) { consumes.Add(formDataMimeType2); consumes.Add(formDataMimeType3); } foreach (var parameter in parameters.ToArray()) { if (!(parameter is NonBodyParameter) || parameter.In != "formData") continue; if (formFileSubParameterNames.Any(p => parameter.Name.StartsWith(p + ".")) || formFilePropertyNames.Contains(parameter.Name)) parameters.Remove(parameter); } foreach (var formFileParameter in formFileParameterNames) { parameters.Add(new NonBodyParameter() { Name = formFileParameter, Type = "file", In = "formData" }); } } } Can anyone help me with the solution?1.1KViews0likes0CommentsExcel application does not launch properly using Tested Apps
Hi, We have requirement of testing an Excel Add-in. To test it we open Excel, Load the add-in, generate formulas and extract data using the add-in and compare the outcome with expected values. We launch excel using TestedApps object and then control excel using COM objects. We are facing an issue while launching excel in which sometimes the Excel gets stuck on the initial pop-up while launching and doesn't proceed. The TestComplete also doesn't respond to this and keeps waiting for the excel to launch. Sometimes it waited for more than 2 days before it was manually terminated. Has anyoe else faced this issue or know how to fix it kindly post it here. Thanks, YusufSolved1.1KViews0likes1CommentHow to resolve the error while opening an excel workbook?
I am trying to open an excel workbook using the below lines of code. It throws an error saying, function Test(){ var Excel; Excel = Sys.OleObject("Excel.Application"); Excel.Visible = true; Excel.Workbooks.Open("D:\\test1.xls"); } "Sorry, we couldn't find D:\test1.xls. Is it possible it was moved, renamed or deleted?" I don't know what's wrong with this simple lines of code. I am using TestComplete 12 and have MS Excel 2016 64 bit installed. Is it causing the problem? Please help!899Views0likes1CommentRead and Write in Excel sheets using VBScripts
I am creating a framework using Excel Sheets for a Desktop application. I am new to TestComplete. I have seen the syntax from Help in Testcomplete. But still I am not able to bring up a solution. For example I have 5 testcases to be executed. I have created an excel with 2 sheets namely Sheet1 and Sheet2 with 4 testcases with headings in Sheet1 as TestCases and Status. In sheet2, i have createdTestcase ID,TestCase,Expected Result,Actual Result,Status,Screenshots,Start Time,End Time,Time Taken. In sheet1, if the status column value is 1 then the Testcase will be executed. If it is 0 then it will not be executed. In sheet2, the actual result should be PASS or FAIL. PASS should be in green color and FAIL should be in RED color. And if both the actual and expected are same then PASS should be mentioned in Status column. And how to add screenshot path for the respective Testcase? Also, I would like to know how to fetch the start time and end time and compare both of them and calculate the total time taken. I need a sample code to fetch details from the excel sheet and to write the same results in that excel sheet. I know it is difficult for me at this stage, but I need your help guys. Awaiting for the answers soon. I have attached the excel sheet for reference.1KViews0likes1Comment