Extracting the data from Grid-table(Windows Application) using Python
Actually I need to get total values of a single column present in the Grid Table .So firsti used the below code for getting the count of Child Items and Names of it which are in the Grid Table. def grd (): Grid = Aliases.teacher_debug.frmMain.dxDockSite.TdxDockPanel.frmListDealNav.TdxDockSite.TdxLayoutDockSite.TdxDockPanel.frameList.grdGridFrame.TcxGridSite if Grid.Exists: Log.Message(Grid.Name,Grid.FullName) for i in range (0,Grid.ChildCount): countchi = Grid.Child(i) Log.Message(countchi.Name,"",0) and the OutPutwas Window("TcxGridSite", "", 1) Am not able to understand what went wrong please guide meSolved7.5KViews0likes53Commentsserver version: uploading test results to Zephyr Scale via the automation API
Hello! I'm using Zepyhr Scale Server and I would like to upload to Zephyr the results of my automation testsuite made with pytest. I've tried this POST request: post(url="https://{my-jira-host}/rest/atm/1.0/automation/execution/{projectKey}", auth=({my_username}, {my_password}), files={"file":open("test_results.zip","rb")}) but it doesn't work because the response is "errorMessages":["Invalid Custom Format JSON file"]}'. I'm uploading a zip file containing one xml file generated with pytest --junitxml=output/junitxml_report.xml as it's explained herehttps://support.smartbear.com/zephyr-scale-cloud/docs/test-automation/pytest-integration.html I've tried to make the same request with an API client (Postman) and the error is"InvalidZIPfile", even if I fail the authentication with a wrong username or even if I upload the xml file only. Maybe someone does the same thing and could help me? I'm a newbie 🙂 thanks!Solved6.4KViews0likes10CommentsJenkins Environment Variables not available in Tests
Hi, I'm using Jenkins to trigger scheduled tests and have recently started to use parameters in Jenkins. The parameters are set as environment variables by Jenkins and can easily be accessed by scripts executed on the Jenkins slave but not from the tests run by TestExecute in the same job. I need to parameters to be able to control which test system I should access from my tests. Sure I could copy the tests, one for each target, and hard code the target in each test, but that would quickly lead to a maintenance nightmare, thus I thought of using Jenkins parameters (and Multi-configuration variables) to do the job for me. Anyone tried this and found a solution to get this working? My setup is as follows: Jenkins, TestComplete Jenkins plugin, Java Web Start as service (on Jenkins slaves), TestExecute, Test written in python. Issue filed in support request: Case #00181940: "Environment variables form Jenkins not available in TestExecute" BR, JohanSolved5.1KViews0likes4CommentsPython speed
I have found python to be extremely slow in test complete. I have created some timing tests iterating over arrays and doing actions with the array data. I also wrote the exact same code and ran it in normal python command shell. In test complete I am getting timing in the range of a few hundred ms all the way up to full second. In command shell I am in the 1 ms range. Are there any known issues with python and test complete? I am doing 0 interactions with my software's ui for this timing test as I wanted to rule out response time from my ui. This all came about because tests just seem very show overall so going back to basics. I am using latest build of test complete. I can share code snippets tomorrow when I am back in the office if that is necessary. Thanks in advance for any feedback.Solved4.8KViews0likes6CommentsSteps to Import Python Library in TestComplete
Hi All, Youtube - Import Python Library in TestComplete I've prepared a step to import python library using Openpyxl library inside test complete. Ref Step 1: Install python 3.6 – TestComplete 14.4 Support 3.6 Ref:https://www.python.org/ftp/python/3.6.0/ Check for Python version in Cmd : python –version Step 2: Download the python library matching the Python version.Ref:https://www.lfd.uci.edu/~gohlke/pythonlibs/ Install Numpy/Openpyxl library in the system Install in cmd line as “pip install Openpyxl” In Command Prompt type “Import Openpyxl” If you don’t get any error then the python library is installed correctly. Step 3: Navigate to default python installed location Eg: C:\Users\UserName\AppData\Local\Programs\Python\Python36 2. Copy all the files to TestComplete path Eg: C:\Program Files (x86)\SmartBear\TestComplete 14\Bin\Extensions\Python\Python36 Step 4: Set your environment variable of python path to Testcomplete path Eg: C:\Program Files (x86)\SmartBear\TestComplete 14\Bin\Extensions\Python\ Step 5: from os import sys import sys sys.path.append(“C:\\Program Files (x86)\\SmartBear\\TestComplete 14\\Bin\Extensions\\Python\\”) openpyxl_location = “C:\\Program Files (x86)\\SmartBear\\TestComplete 14\\Bin\Extensions\\Python\\Python36\\Lib\\” sys.path.insert(0, openpyxl_location) import openpyxl from openpyxl import Workbook Ref:https://vallatestcomplete.wordpress.com/2020/06/01/testcomplete-python-library-import/ Regards Valla4.3KViews4likes2Commentsadding a (python) list to project suite variable from database
Hi All, Am trying to fetch the values from database which am able to do now after fetching, I want to add those values as a list in to single project suite variablebut here its storing only the last loop variable. And if when there is space like in between South East ,from DB it is unable to fetch the particular value I tried concatenation every thing but its not working. area of i in the below code contains = North, South, East , South East , West. def dbarea(): for i in range(0,5): area = ProjectSuite.Variables.Location #DBquery =ProjectSuite.Variables.Deal_DBQuery area = area.split(",") Log.Message(str(area[i])) AConnection = ADO.CreateADOConnection() # Specify the connection string AConnection.ConnectionString = "Provider=MSDASQL.1;" + \ "Data Source=LMk2 Penelope"; #AConnection.ConnectionString = "Provider=MSDASQL.1;" + \ #"Data Source=itvuat"; AConnection.LoginPrompt = False AConnection.Open() #Log.Message((area[i])) # Execute a simple query RecSet = AConnection.Execute_('select sare_no from sare where short_name='+str(area[i])) RecSet.MoveFirst(); data_container = [] r= [] while not RecSet.EOF: # rows1 = "" rows = RecSet.Fields.Item["Sare_no"].Value data_container.append(rows) # rows = rows.append(",") #rows.split(",") #Log.Message(rows) RecSet.MoveNext() AConnection.Close() Log.Message(str(data_container)) dbcount = len(data_container) Log.Message("The Database Count is :"+str(dbcount)) ProjectSuite.Variables.AddVariable("Var5","String") ProjectSuite.Variables.Var5 = str(data_container) Log.Message(ProjectSuite.Variables.Var5) Kindly let me know any suggestionsSolved4.1KViews0likes9CommentsReading the Test-Case and Test-Data from Excel Using Python
Hii All My Aim is toRead the Execution Col if its Yes then it need to Take the values of that particular row and call those functions : Now for the first when am Trying to Read data from excel I have coded this from the Test-Complete Article RecNo = 0 # Posts data to the log (helper routine) def ProcessData(): global RecNo Fldr = Log.CreateFolder("Record: " + aqConvert.VarToStr(RecNo)) Log.PushLogFolder(Fldr) for i in range(DDT.CurrentDriver.ColumnCount): Log.Message(DDT.CurrentDriver.ColumnName[i] + ": " + aqConvert.VarToStr(DDT.CurrentDriver.Value[i])) Log.PopLogFolder() RecNo = RecNo + 1 # Creates the driver (main routine) def TestDriver(): # Creates the driver # If you connect to an Excel 2007 sheet, use the following method call: Driver = DDT.ExcelDriver("C:\\DriverSheet.xls", "TestStep",True) # Iterates through records while not Driver.EOF(): ProcessData(); # Processes data Driver.Next(); # Goes to the next record # Closes the driver DDT.CloseDriver(Driver.Name); But the OutPut of this Displaying as Record 1 Record 2 ....Record4 that's it . Where did i went wrong or else do i need to add something else to the above codeSolved4KViews0likes7CommentsCalling 3rd party packages from scripts written in Python
Hello, I'm trying to import external 3rd party packages from my scripts written in Python language. Is there a way to use Python installed in different folder? I was trying to use default "site-packages" folder - I added 3rd party package to the folder, also copied whole content, installed it from commad line (by using PIP) and tried to call it from script, but TestComplete shows: "no module named requests". I wrote in script also: from os import sys sys.path.append("C:\Data\Python\Lib\site-packages") and then try to import 3rd party module, but there's also no effect. I don't want to use PyUnit, so is there any way to load 3rd party package in TestComplete in scripts? Best Regards, matjuSolved4KViews0likes7CommentsCan we use shell.SendKeys with Testcomplete + Python
How can I select using Keys like Esc ,Tab ,Enter & all thearrowkeys in test-complete any example pleasefor a desktop Application. I know that we can do in python outside Test-Complete but I want a example or suggestion how use in the test-complete scripts with python.Solved3.1KViews0likes6Comments