Contributions
Re: Additional parameter causing Exception
If this is JS you can just work with objects. a function that takes in a vehicle. You can come up with a spec for the object itself, and and have the function takes in the object and check if the object has certain properties. Below, a car has 2 properties while a bike only has one. But the function takes care of both cases. It simply check if the vehicle you passed it has an engine... function upgradeVehicle(vehicle) { vehicle.speed ++ if (vehicle.engine) { vehicle.engine === "V8" } } let bicycle = { speed : 1 } let car = { speed : 4, engine : "oldrustyengine" } upgradeVehicle(bicycle) // bicycle.speed == 2 upgradeVehicle(car) // car.speed == 5 ; car.engine == "V8"888Views1like0CommentsRe: Path of included file
If you put it in the static path, once you check it back into git, you still need to change the version numbers. Because dependencies are different. If you have 8 Apps, and you update App1, you want the other Apps that depend on App1 to still use the previous version of App1. Some Apps will update faster than others, so the dependencies can get quite intricate. Currently thats being handled via cfg files. I'll handle the file paths via cfg files for now too. I haven't looked at "FileFiles" but I'll take a look at that to see if its a good usecase. Thanks!2.3KViews0likes0CommentsRe: Path of included file
Hmmm So lets say App1 - C:\Projects\App1\v1.3.2\scripts\Unit.js App2 - C:\Projects\App2\v.2.3.1\scripts\Unit2.js So in App2, I included a script from App1. Problem is in Unit.js, it doesn't know that it actually belongs to "App1." So Even I go back to the projects folder (that they share), I wouldn't knowhow to proceed into App1 folder. Unless in App1 Unit.js itself, I hard-code something like dir=App1... but that doesnt work when we include git versions unless we update the hard-code each time. The last way I could think of isprovide a soft link in the directory to the latest version. And in App1 Unit.js I hard-code App1\latest and it can redirect to the latest v... but its so round-about. Thanks2.3KViews0likes2CommentsRe: Path of included file
Good question... So longer story. We have a function that reads data from excel spreadsheet. Let's call it readExcel(). As you know, you need path of the sheet you want to read it from. Now, we have different applications (one for each project) and we export the classes out of it. Some projects need 2 applications, so the code will look like: const App1 = require('App1') const App2 = require('App2') Each app should be able to read from their respective excel spreadsheets. App1.readExcel("Orders") App2.readExcel("Orders") But because they are 2 different apps, the "Orders" spreadsheets are in different locations. So in App2, I want it to just know to read the Orders spreadsheet from the App2 directory. I kinda don't want to hardcode the path either, because of version control. If I set the path anywhere as App2/v1.231/Orders.xls, it will need to be changed whenever we change the version, which happens a lot. So I wanted to just say hey look for the Orders.xls in the directory where the file you are in currently... ... if that makes sense. This is the lazy solution I have for now. But welcome to take a diff approach entirely2.4KViews0likes3CommentsPath of included file
So I have 2 projects and they share some common code. Project1 is C:\Project1\one.pjs. It has a script file projOneLib.js Project2 is C:\Project2\two.pjs. It has 2 script files. One is projTwoLib.js, but I also included the script file from Project1, projOneLib.js. Now, while running Project2, I need the location of projOneLib.js' path. How would I do that? I need a way to say, grab me the original file location of projOneLib.js. This can't be too hard-coded either, so in projOneLib.js, if I can save its own file location to a in-memory variable, that'd be good. Thanks!Solved2.4KViews0likes8CommentsRe: FindAllChildren doesn't really return an array
Thanks! Yea I wanted to nitpick because I wanted to organically perform functional programming on it. I think if they update their docs that'd be okay :) let list = Array.from(Grid.FindAllChildren(...)) // Use Array.from to convert their obj into an actual array. return list.map(obj=>obj.wText).filter(text=>text!='Error') // convert to array of just obj.wText, then filter it to discard the ones that are not 'Error'.1.2KViews0likes1CommentFindAllChildren doesn't really return an array
For JavaScript, the docs claim it returns an array. But it really doesn't. It returns an array like object iterable. Please ask devs to return an actual javascript array so I don't need to convert them :) or at least mixin the Array functions like map, filter etc. let SomeObjects = Grid.FindAllChildren(["ClrClassName"],["ComboBox"],10) Log.Message(Array.isArray(SomeObjects)) // false Log.Message(Array.isArray(Array.from(SomeObjects))) // true1.2KViews0likes3CommentsRe: Why TestComplete cannot detect objects n windows security popup (to enter credentials ) in windows10
For these type of windows things I recommend using AutoHotKeys. You also get to pad your resume a little ;) It seems like you just need the tool to enter credentials. Using TC for this is like calling a bomb strike on a tricycle.2.4KViews0likes0CommentsRe: TestComplete/Execute process not closing automatically
Funny you mention mutex. Is this a virtual machine? Like is your box running 4 VMs, in turn running multiple TestCompletes? Is it possible that your box does not have 4 cores, thus running into mutex locks? Note I'm just using an arbitrary number. It's possible you're running 16 VMs using only 4 CPUs. Try putting a random delay in each batch file. https://stackoverflow.com/questions/34524/what-is-a-mutex1.1KViews0likes0Comments