Forum Discussion
My understanding is that you are converting your existing scripts to Python, and you are now getting a runtime error? How is your Python function defined and what parameters are you passing?
If you could provide a simple answer, that you be great.
Thanks for your response.
Yes, we are converting the existing VBScript code into Python.
Please find below for the Python routine:
here we are just replacing the VBScript keyword into python keyword.
def RunOrderSheet():
TC_NO_Runorder = RunOrderSheetCelVal.Value["Tc No"]
Execution = RunOrderSheetCelVal.Value["Execute"]
Datasheet_Flag = RunOrderSheetCelVal.Value["Datasheet_Flag"]
ModuleName_runorder = RunOrderSheetCelVal.Value["ModuleName"]
TestcaseDesr = RunOrderSheetCelVal.Value["Descirption"]
if Execution == "YES":
import PyDriverScript
PyDriverScript.DataSheet(TC_NO_Runorder,ModuleName_runorder,Datasheet_Flag,TestcaseDesr)
#-----------------------------------------------
def DataSheet(TC_NO_Runorder,ModuleName_runorder,Datasheet_Flag,TestcaseDesr):
TC_NO_Datasheet = DBVar1.value["Tc No"]
TC_Description_Datasheet = DBVar1.value["Tc Descirption"]
ModuleName_Datasheet = DBVar1.value["ModuleName"]
if TC_NO_Datasheet == TC_NO_Runorder and ModuleName_Datasheet == ModuleName_runorder:
Property_Name = DBVar1.value["Propertyname"]
Property_Value = DBVar1.value["Propertyvalue"]
Data = DBVar1.value["Data"]
ModuleName_Datasheet = DBVar1.value["ModuleName"]
Testcaseno = DBVar1.Value["Tc No"]
Process_Name = DBVar1.value["Processname"]
Testlink_Id = DBVar1.value["Testlinkid"]
Execute(TC_Description_Datasheet)&""""&Property_Name&""""&","&""""&Property_Value&""""&","&""""&Data&""""&","&""""&ModuleName_Datasheet&""""&","&""""&TestcaseDesr&""""&","&""""&Testcaseno&""""&","&""""&Process_Name&""""&","&""""&Testlink_Id&""""
#-----------------------------------
If we run the above-mentioned python code with log.message method, we get all the required values from the Excel and successfully posted the messages in the test log for the RunOrderSheet() and DataSheet() routines.
But as we said already, when it reaches Execute line, we got that run time error.
Please inform us, if you are not clear.
Thanks.
Related Content
Recent Discussions
- 8 hours ago
- 7 days ago
- 10 days ago