Run Python Code

i_completed
activities

#21

I have a Python automation framework already built to suit my automation requirements in my project. Includes stuff like execution of automated tests in a data-driver manner while also creating test suites and test sets for different requirements for execution. However I’d like to include execution of some browser / website tests using UiPath through the same framework. Is there any ready Python API or at least a Command line API that I could use?

I am a newbie to UiPath. I’ve downloaded the trial version and tried to write a few scripts in the Studio. Haven’t tried other modules of UiPath like Orchestrator or Robot. So if someone can even point me in the right direction for my problem, I’d really appreciate it.


#22

There is not a native Python integration in UiPath. However, you can still execute Windows command using batch files. So you could write a batch script that executes your Python code.

Or (what I have done in the past), you can compile your Python code using PyInstaller and then run the .exe file.


#23

I think the question got misinterpreted.
I wish to execute UiPath tests from my Python code, not the other way around. So I would like to run something like:

python uipath_test1.ui where the uipath_test1.ui script is my UiPath script that can be executed from a command prompt or from Python chevron prompt.


#24

Unfortunately Sumeet you cannot do that. UiPath is built on top of Microsoft Workflow foundation framework and uses more sophisticated .xaml (WPF). Ironpython at the moment supports Xaml but cannot compile and run WF created Xaml. the extension of Uipath code is .xaml like Main.xaml. you can find that as below


You can try to investigate more by opening that in Notepad++ and see if there is a way to call and compile code using Python. But I would strongly suggest use to UiRobot.
you can go through their docs for that
https://robot.uipath.com/


#25

Hi Sumeet,

You can use Orchestrator to start a process remotely either on demand or by a schedule.
There is a free course in UiPath Academy where you can find out how to use Orchestrator and there is also a community edition available.
Also, Orchestrator exposes a REST API which can be used to trigger the execution of a process from another tool, like your Python automation framework.


#26

Thank you for the direct link to UiPath Robot.


#27

Thank you for the direct link to the Orchestrator and REST API. So I have 2 questions arising out of your answer:

  1. You said Orchestrator and then mentioned ‘there is also the community edition’. Does that mean that the Community edition - the free one - doesn’t have Orchestrator module?
  2. So just to be clear, I’d have to prepare Orchestrator jobs to run my UiPath scripts and then I’ll have to call these Orchestrator jobs using the REST API?

#28

@SumeetAgrawal

Uipath provides the demo Orchestrator with community edition but you have to register as a tenant to access it https://demo.uipath.com/account/login?returnUrl=%2Frobots

Regards,
Sreekanth.k


#29

Maybe there will encounter a publish error like : ‘the package is too large’ .
so My suggestion is somethings like below:
1.install Ui Path platform instead of commnity version
2.Go to MyGet to creat your feed
3.Create tenant in https://demo.uipath.com
4.rewrite your Orchestrator setting like
Deployment URL: the feed name you created at step2
API Key: API key of your MyGet feed
5.To Publish a project

Regards,
lainh


#30

I am a beginner in UiPath. So my questions might seem odd.
All above responses indicate that if I have to use a Community Version of UiPath, I will not be able to execute the tests locally? I will have to publish my project so that the entire project is like writing in GitHUB or something like that and then use the Orchestrator feed to run Robots for execution of my scripts?
So if I install community version, is there no way to execute my UiPath projects locally?


#31

Locally,you can execute your projects through UiRobot by using some “bat” command like:

C:\Users{your name}\AppData\Local\UiPath\app-18.1.2\UiRobot.exe
-file:“D:\UiPath\InputArgument\Main.xaml” -input:{“inputValue”:“helloworld”}


#32

A post was split to a new topic: How to execute Python script?


#33

18%20PM


#34

How can i use this…
Is there any sample workflow that i can start with?


#37

Hi, Did u get your script running?
I am actually using Run Python Script inside the Python scope - but getting exceptions as it doesn’t seem to find a file… thanks!


#38

This usually works if you use 32-bit python…
you have to just pass path of that into python scope…for e.g. “c:\python-32bit” the folder where 32 bit python.exe resides and then you are able to run python scripts.
Also make sure that you have set path of 32 bit python in environment variables in system properties of windows.


#39

Here is an example:


#40

A post was split to a new topic: Run projects with Orchestrator CE