Variable declaration in a javascript class
Hi, Can we declare global variables within a javascipt class, outside a function? When I try to declare a variable, it gives error: Syntax Error: Unexpected identifier Sample code: class Test { var abc; //received above error var abc = "Test"; //received above error let def; //received above error function1() { //some code here var abcd = "New"; //works fine here } Please suggest how I can create variables outside the functions in this scenario. Thanks!Solved28KViews0likes2CommentsComparing table data in IF not working
Hello, I have this weird problem were everything seems correct but TC isn't doing the correct steps. I have a data driven loop, and I am going to check if the product number is a specific product, and it should do the steps I want. This has worked in the past, not sure why it stopped working. In the image below, in the blue box, the product number is filled in - this is correct. For the sake of testing, I added the yellow box - these also give and store the correct values. The problem is in the red box, for some unknown reason it just skips the if. Below is a small snippet of the test log, and you can see that the log action provided the correct product number. Also, you can see that the text in the textbox is also the correct value. And lastly a screenshot of the if itself. Can anybody help me notice the issue? Thanks in advance. LuukSolved7.9KViews0likes28CommentsHow to reach the expected object to map in a combox
Hello all, I have an issue to map an object inside a combo box. Steps followed : - On TC, click on map object icon and select Point and fix option - On my app, open the combo box, point object to map and press shift + ctrl + A - Check object map : I map the border of my object not the object itself. I tried some many times and I also got the same result, I'm not successed to catch only the object, without the border. Full path of the object expected for :[...].WPFObject("ToggleButton", "", 1) Full path of the object mapped : WPFObject("ToggleButton", "", 2).WPFObject("ButtonBorder") Is it possible to "delete" this part ".WPFObject("ButtonBorder")" from the full path ? NB: usually I used the tree for "Object Browser" but because it's a combo box it's not possible (the combo box closed itself and I click somewhere else) Thank you AliciaSolved4.5KViews0likes12CommentsRead excel data/links in javascript test complete
Hi team, I have tried to read the data file using javascript in test complete.But shows error as "Type error: cannot read the property 'SheetByTitle' of null" functionExcelRead() { varexcelFile = Excel.Open("C:\\temp\\DataStorageExcel.xlsx"); varexcelSheet = excelFile.SheetByTitle("Sheet1"); varvalueA = excelSheet.Cell("A", 3).Value; varvalueB = excelSheet.Cell(2, 3).Value; varvalueC = excelSheet.CellByName("C3").Value; } Can any one help regarding this issue or I want to fetch the weblinks from excel file one by one that links need to execute. Thanks in advance.Solved4.3KViews0likes4CommentsRunning the same test case in Test Complete Multiple Times
I have a couple of test cases that I am generating for a Website and I need to set up several of the cases so that they will run multiple times during my testing of the product. I want be able to add to 20 new records and then update them as we are going.4KViews0likes27CommentsThird Party Python Modules For Excel Read
We've been trying to implement use of third party python modules in TestComplete but we're running into everyone's issues in compatibility with TC and external Python modules. At this point, we are running into issue that on secondary run that "import failed with 'NoneType' object is not callable." (https://community.smartbear.com/t5/TestComplete-General-Discussions/Python-fail-to-import-lib-during-the-second-attempt-to-run/td-p/153683). We've been trying to import module xlwings that requires a module name win32api . It seems that TestComplete has issues running this module. We've follow all the install instructions on the forums but we can't seem to get the excel module to work. Has anyone been able to intergrate win32api with their TestComplete code successfully? Edit: We are performing more dynamic tests than bellow including using the COM server for find, createworkbook, etc. Sample code was in Python but Python code took 15 minutes compare to VB which took 1 minute to read a 1375 line workbook)Solved3.1KViews0likes6CommentsWhat would be a good approach to build a framework for data driven testing
I'm trying to build a framework and working on ways to maintain test data in a effective manner. So thought of asking some suggestions here to see if any testcomplete offers something to make this easier. Approach1 Create an excel sheet with all the testcases and its data, and write code using testcomplete's exceldriver methods to read the excel file and call the corresponding methods. I prefer using scripting to create tests rather than keyword tests, so each testcase listed in the excel sheet is a method/function. But in this approach, if i have 100 testcases and in total there are 50 different parameters i would end up having 50 columns, which would make it very difficult to manage. And i also need to execute the same testcase with different testdata Approach2 Use the built-in test executing framework withintestcomplete, save test data into text files and have it in Stores. Read the text files to retrieve testdata. One file for each testcase Or suggest a way which you think might be effectiveSolved2.8KViews0likes5CommentsRun test cases in multiple environments for desktop application
I am working with desktop application. We have around few test cases and these has to be run on multiple environments. We are writing scripts and not keyword tests. By passing path of environment as project variable, i am able to run in one environment without issue. But I want to run all these test cases in all the environments without changing the variable value manually everytime. And i want selection option of testitem from project. Is it possible to iterate by number of items in tested apps or to set iteration count of parent case from script? Is there any other way to iterate with different environments? Please help me as i am stuck here.Solved2.8KViews0likes11CommentsConfigure IE11 before running a TestComplete script
I am querying the forum to see if someone has ever write a script to preconfigured IE11 before executing their scripts. Probably WinReg changes ??? i.e. Tools -> Internet Options open in new tab versus a new IE window Thanks, JamesK2.6KViews0likes5CommentsTestComplete failing to detect the overlapping window that is on the screen
I need to interact with an Overlapping Window in a Silverlight application. Which I believe means that the window is considered a borderless window. Test Complete is also able to detect the buttons on the window that I need to interact with, as Exists or as Visible. The problem is that when I try to click on the button, I get a popup saying that Test Complete is waiting on the overlapping Window to become visible. From what I can tell, it is, and I have already found the UIAObject that is actively on the screen that I need to interact with, but TestComplete will tell me that it is waiting for the overlapping screen to become visible. While diving through Object Browser, I found that this particular window only exists within the Tree while it is on the screen. So if I found that the object does exists, and that the button on that screen itself exists, I am not certain which window TestComplete believes it's waiting for. The worst part of all of this is, that it fails probably about 60% of the times I run it. For sometime I thought it was a timing issue, so I put a 2 second delay in, but that didn't really change the success/failure rate. I went diving through community posts, but I haven't been able to locate anything similar to what I am seeing. I am paste the code below. I get the 'Waiting on the overlapping window to become visible' message for TestComplete at the btnLogYes.Click() line. After it has already detected that the logWindow exists, otherwise it skips over the button press, because if the logWindow doesn't exist, the Yes Button doesn't exist either. I am also attaching the screen shot of my Overlapping Windows parameters in Playback. I suspect that this is going to be some form of weird Memory issue with SilverLight... Any help would be greatly appreciated! Log.Message("Pressing the Log Button"); global.commsLog.click(); Delay(2000); Log.Message("Looking if the Log Window 'Yes' button is on the screen"); var parent = NameMapping.Sys.sllauncher.wndMyAvail.ShellEmbedding.ShellDocObjectView.browser.Silverlight_Control.Initializing_Application var logWindow = parent.FindChild("ObjectIdentifier", "RadBusyIndicator"); var btnLogYes = logWindow.FindChild("ObjectIdentifier", "Yes", 0, true); // Finish Logging the message Log.Message("Pressing the Yes Button to finish logging the messages"); if (logWindow.Exists) { Log.Message("The Yes Log Button was visible, Click it!"); btnLogYes.Click(); } else { Log.Message("The Yes Log Button was not visible"); }Solved2.5KViews0likes5Comments