0

I'm trying to run the python code from the robot framework.

But sometimes it works fine and creating a folder in the location and sometimes it opening the python code in notepad instead of running the python code.

robot framework

*** Settings ****
Library  Process
Library  OperatingSystem
*** Variables ***
*** Test Cases ***
Start logonpad
    OperatingSystem.run     foldercreate.py

python code

import os  
import pandas  
os.mkdir("G:/NewFolder")  

I have tried to restart the machine and tried it again then also facing the same issue.

Note: I need to know why it's running sometimes and opening the code at other times.

2 Answers 2

1

Most probably because of the different OS user profiles used for running the tests.

To be sure it is always the one you actually want to process the file, specify the binary, e.g. for python:

OperatingSystem.run     python foldercreate.py

Similarly, use "notepad" if you do want the other.

Sign up to request clarification or add additional context in comments.

Comments

0

try this with Run process:

${result2}=  Run process  python  C:/Users/Specimen/RobotFrameWorkExperience/iotCentral/parking_set.py  ${parkingset1}  True   alias=myproc2
        Log to Console  ${result2.stdout}  console=yes

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.