Forum Discussion
tristaanogre
8 years agoEsteemed Contributor
You can do either this
from Script1 import * def callScript1Methods(): test1() test2()
or this
import Script1 def callScript1Methods(): Script1.test1() Script1.test2()
Notice in the second example, you need to explicitly indicate the unit from which you are getting the routine. If you are using the syntax of from <unit> import * you don't need to specify the unit name in the method calls.
See https://support.smartbear.com/testcomplete/docs/scripting/calling-routines/declared-in-another-unit/python.html
- tristaanogre8 years agoEsteemed Contributor
Unless my syntax is incorrect karthick7, USEUNIT is not supported for Python in TestComplete. I tried the following:
#[Unit1] def test1(): Log.Message('this is test 1') #[Unit2] #USEUNIT Unit1 def test2(): Unit1.test1()
- karthick78 years agoContributor
tristaanogre Thanks For your information.
Related Content
- 10 months agolodecesa
Recent Discussions
- 3 hours agoSlickRick
- 4 hours agoSlickRick
Name Mapping Issue
Solved6 hours agokgreger1