Luxoft / Twister

Twister Test Automation Framework
http://www.twistertesting.com/
Apache License 2.0
38 stars 21 forks source link

Unable to call user definied python Module (ie. from module import moduleName) #174

Closed Hamza989 closed 9 years ago

Hamza989 commented 9 years ago

Team,

I am facing the issue while importing the user defined python module . Twister throws error message saying import error.

please find the detailed description as mentioned below twister version v3.053

-Hamza

From: Twister Support [mailto:twister_support@luxoft.com] Sent: Friday, April 17, 2015 11:22 AM To: Hamza Ta Subject: Re: [Tsc_twister_list] Twister Issue

Hi,

We did a quick investigation and looks like there is an issue on this area. It should work with "deep" option for libraries and follow python behavior. Please raise an issue on github and we will fix it in quick time ( 2-3 days ). Sorry for the hustle !

Kind regards, Twister team. On 16.04.2015 19:18, Hamza Ta wrote: HI Team, The work around which was suggested by the team is not what python behavior for importing the Module. we are developing automation framework using python. There will be many modules with same name, and it is difficult to maintain or follow this workaround for bigger project. Let me know why this feature not supported on v3.053 of twister , whereas v3.016 it is supporting

-Hamza From: Twister Support [mailto:twister_support@luxoft.com] Sent: Thursday, April 16, 2015 3:29 PM To: Hamza Ta Subject: Re: [Tsc_twister_list] Twister Issue

Hi there,

In the libraries window, select only the hellomodule.py file and in your runHello.py just do import hellomodule.py

This will work.

Best regards, Twister team On 16.04.2015 11:32, Hamza Ta wrote:

Team, Please find the attached simple python module . See the import error message generated by twister server version v3.053

Whereas v3.016 showing the result as expected… Please help me to figure out this issue

-Hamza

From: Twister Support [mailto:twister_support@luxoft.com] Sent: Thursday, April 16, 2015 11:41 AM To: Hamza Ta Subject: Re: [Tsc_twister_list] Twister Issue

Hi,

There are two steps involved in using modules ( .py files ). First, all the modules ( .py files ) must be stored in /opt/twister/lib directory so Twister can detect them. Second, the module file must be selected in GUI, so they can be accessed by the execution engines. To select the libraries needed for tests, press Libraries button and do the selection in Libraries window. Multiple libraries can be selected using CTRL ( one by one ) or SHIFT ( range of tests ) keys.

If you have any other questions, please do not hesitate to contact us.

Kind regards, Twister team. On 15.04.2015 23:25, Hamza Ta wrote: Hi,

If I have a module called Host and it has contain two files linux and windows.py. Here twister is failing by saying Test case exception: File "/home/auto/twister/client/executionprocess/ExecutionProcess.py", line 1186, in tests result = current_runner._eval(str_to_execute, globs, args) File "/home/auto/twister/client/executionprocess/RunnerClasses.py", line 253, in _eval execfile(fpath, globs_copy) File "/home/auto/twister/.twister_cache/localhost.localdomain_EP-1001/R5_BACK.py", line 22, in from Main import Main File "/home/auto/twister/.twister_cache/localhost.localdomain_EP-1001/ce_libs/Main.py", line 8, in from devices.host.Linux import Linux ImportError: No module named devices.host.Linux

File /home/auto/twister/demo/R5_BACK.py execution CRASHED. <<<

Test statistics: Start time 2015-04-15 23:14:33 -- End time 2015-04-15 23:14:33 -- 0.12 sec. Here this code works fine if It executes through python console. Please let me know, is there any solution for adding modules inside twister. My system configuration is as mentioned below; Opeating system : rhel 7.1
Twister automation framework version; build 3.053

-Hamza


This e-mail and any attachment(s) are intended only for the recipient(s) named above and others who have been specifically authorized to receive them. They may contain confidential information. If you are not the intended recipient, please do not read this email or its attachment(s). Furthermore, you are hereby notified that any dissemination, distribution or copying of this e-mail and any attachment(s) is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender by replying to this e-mail and then delete this e-mail and any attachment(s) or copies thereof from your system. Thank you.


Tsc_twister_list mailing list Tsc_twister_list@romania.luxoft.com http://mail.romania.luxoft.com/mailman/listinfo/tsc_twister_list

This e-mail and any attachment(s) are intended only for the recipient(s) named above and others who have been specifically authorized to receive them. They may contain confidential information. If you are not the intended recipient, please do not read this email or its attachment(s). Furthermore, you are hereby notified that any dissemination, distribution or copying of this e-mail and any attachment(s) is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender by replying to this e-mail and then delete this e-mail and any attachment(s) or copies thereof from your system. Thank you.


This e-mail and any attachment(s) are intended only for the recipient(s) named above and others who have been specifically authorized to receive them. They may contain confidential information. If you are not the intended recipient, please do not read this email or its attachment(s). Furthermore, you are hereby notified that any dissemination, distribution or copying of this e-mail and any attachment(s) is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender by replying to this e-mail and then delete this e-mail and any attachment(s) or copies thereof from your system. Thank you.


Tsc_twister_list mailing list Tsc_twister_list@romania.luxoft.com http://mail.romania.luxoft.com/mailman/listinfo/tsc_twister_list

This e-mail and any attachment(s) are intended only for the recipient(s) named above and others who have been specifically authorized to receive them. They may contain confidential information. If you are not the intended recipient, please do not read this email or its attachment(s). Furthermore, you are hereby notified that any dissemination, distribution or copying of this e-mail and any attachment(s) is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender by replying to this e-mail and then delete this e-mail and any attachment(s) or copies thereof from your system. Thank you.


This e-mail and any attachment(s) are intended only for the recipient(s) named above and others who have been specifically authorized to receive them. They may contain confidential information. If you are not the intended recipient, please do not read this email or its attachment(s). Furthermore, you are hereby notified that any dissemination, distribution or copying of this e-mail and any attachment(s) is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender by replying to this e-mail and then delete this e-mail and any attachment(s) or copies thereof from your system. Thank you.


Tsc_twister_list mailing list Tsc_twister_list@romania.luxoft.com http://mail.romania.luxoft.com/mailman/listinfo/tsc_twister_list

This e-mail and any attachment(s) are intended only for the recipient(s) named above and others who have been specifically authorized to receive them. They may contain confidential information. If you are not the intended recipient, please do not read this email or its attachment(s). Furthermore, you are hereby notified that any dissemination, distribution or copying of this e-mail and any attachment(s) is strictly prohibited. If you have received this e-mail in error, please immediately notify the sender by replying to this e-mail and then delete this e-mail and any attachment(s) or copies thereof from your system. Thank you.

bogdanpopescu commented 9 years ago

@Hamza989 Please verify the fix

Hamza989 commented 9 years ago

Thanks for your great support !!!! I have verified latest Twister v.3.057. It is working fine. Hence I am closing this defect. Once Again.Thanks