Contributions
"Folders" in name mapping Aliases
Hi, Name mapping is a cool way to save code room on objects paths. My main concern though is that there are too many of them and it's getting messy, and it's hard to find them in the Aliases list. How about adding some sort of "folders" that would divide them to sections base on module\subject\context and yet are meaningless code-wise?505Views0likes0CommentsRe: python lib is not recognized as valid win32 app
To solve it for future users with the same problems: The reason i could not access the Python 3.6 and kept being directed to the 3.4 is that my code used an external library (numpy) that wasn't installed correctly in the TestComplete 3.6, and so, when my code tried to import it - it went to the 3.4 - where the numpy WAS installed. Installing the numpy corectly on the 3.6 - solved the issue and indeed there is NO issue with having 2 versions of Python on the same PC. Here is a link for the numpy installation issue: https://community.smartbear.com/t5/TestComplete-Desktop-Testing/integrating-WHL-Python-packages/m-p/167379/highlight/true#M12755 chears, Nadav.5KViews2likes0CommentsRe: integrating WHL Python packages
Just to close the loop and save time for future users with the same problem, the solution is as followed: 1. open the WHL file with 7-zip 2. extract the folders in it to"C:\Program Files (x86)\SmartBear\TestComplete 12\Bin\Extensions\Python\Python36\Lib\site-packages" folder. 3. add these lines to the start of your code: import sys sys.path.insert(0, 'C:\Program Files (x86)\SmartBear\TestComplete 12\Bin\Extensions\Python\Python36\Lib\site-packages' import <your lib name (in my case: numpy)> that worked like a charm. *** credit to Yuriy from SmartBear Customer Care for the solution ***3.1KViews2likes1Comment- 3.1KViews0likes3Comments
Re: integrating WHL Python packages
OK.. your right - i kind of started from the middle here.. so here it is: i'm using the latest TC (12.50.4142.7) and running it with the X86 version. No Python installed other than the one supplied by TC. I've put the whl file in the site-packages folder as needed. (the regular bin, not the X64 one, since i'm using the X86) my code: numpy_location = 'C:\\Program Files (x86)\\SmartBear\\TestComplete 12\\Bin\\Extensions\\Python\\Python36\Lib\site-packages\\numpy-1.14.5-cp36-none-win32.whl' from os import sys sys.path.insert(0,numpy_location) import numpy as np def test(): a = [1,2,3] b = np.array(a) print(b) when i ran it - i've stopped with breakpoint before this line: b = np.array(a) just to make sure that there are no errors before that line, and everything was ok. but running this specific line (which is the must basic and simple action you can do with the numpy library), i get this error (screenshot attached as well): Import error: Importing the multiarray numpy extension module failed. Most likely you are trying to import a failed build of Numpy . Just to make sure - i've redownloaded that file again and also made sure that it worked fine on another PC without TC. thanks again. Nadav.3.1KViews0likes0CommentsRe: integrating WHL Python packages
Yeah, i read that page many times looking for clues.. That's why i specified the community examples as well.. There it's only egg files. Anyway, this whole procedure is not "normal Python stuff" because this is not how Python external libraries are installed. Also, like i said - i'm not sure if it's an egg\whl issue, or some other limitation to integrate complected Python libraries.. Is there anyone here who knows how does this import really work?3.2KViews0likes8Commentsintegrating WHL Python packages
Hi, as far as i can understand from the documentation and examples here in the community - TC supports integrating external Python libraries using EGG files, which is a very old (since 2004) format. Since 2012, the format in use is mostly WHL, and many libraries does not offer you the egg files anymore.. I know that there are converting tools, like HUMPTY but they are on a "it worked for me" bases, since no one can guarantee or promises that nothing won't get mixed up from that convert.. Is there a way to use WHL files too? I've tried it with numpy WHL file and it did not work. (can't attach it here for some reason. you can download here: https://pypi.org/project/numpy/#files) I'm not sure if it didn't work because the WHL is not supported or because of some other stuff (maybe not all external libs can be integrated? see the message from baxatob,06-21-2017 11:45 AM, in this link(,): https://community.smartbear.com/t5/TestComplete-Mobile-Application/How-do-i-add-Python-Libraries-and-extend-the-Pyton-support-on/m-p/118787#M973) thanks, Nadav.Solved3.4KViews0likes10Comments- 1KViews0likes0Comments
Re: python lib is not recognized as valid win32 app
well, i do use external packges as well, but urllib is an internal Python library and not external - there is no specific file or installation needed for it. i did as you advised, looked in the TC installation folder for the urllib folder and specified it's path like this: urllib_path = 'C:\\Program Files (x86)\\SmartBear\\TestComplete 12\\Bin\\Extensions\\Python\\Python36\\Lib\\urllib' sys.path.insert(0,urllib_path) import urllib.request and i still get the same error about the Python version being incompatible. also tried to move the script file i'm calling (that uses the urllib) to the C:\Program Files (x86)\SmartBear\TestComplete 12\Bin\Extensions\Python\Python36\Lib folder, instead of leaving it in the project - still the same error. what i my options (other than removing my Python 3.4 installation and installing 3.6 (which is not really in options)? is there a way to make it go to the 3.6?5.7KViews0likes2Comments