Forum Discussion
I had shown you two examples of calling the same function. One allows to execute arbitrary Python code from a string using exec method,
exec("Unit2.Greetings(\"SmartBear\")")
and the other is calling the function as normal,
Unit2.Greetings("TestComplete")
I suggest you call the function as normal, and also look at the example code I have provided and compare it with what you have written (you have already done this correctly in line 11). You should then able to correct your code and get it working.
If you still having issues, then I suggest you create a new Python project in TestComplete, and copy the example that I have provided, to understand how import works.
- Arulmurugan2 years agoOccasional Contributor
Thank you for your response.
As you said, we have created a new Python project and implemented your suggestions as 2 files, Unit1 and Unit2 and it works without any issue, as shown in the below Screenshot.
As mentioned above, we tried that exec(str) approach, like how you send parameters from Unit1 to Unit2 in your example.
we are sending the parameters from PyDriverScript to PyFun but it is failed.
If you look into my code, which I shared you yesterday then you can come to know how we are sending the parameters to another function in Python.
The same error which I mentioned earlier only occurred again.
Thanks.
Related Content
Recent Discussions
- 8 hours ago
- 7 days ago
- 10 days ago