Forum Discussion
hkim5
Staff
5 years agoi tried your original code block (which worked fine for me), and tried commenting out the "pass" (which didnt seem necessary) which also worked, and then used elif instead if reoccuring if's and that also worked for me.
so i don't know whats happening with your system, but to me given that the project variable is (for example) QAT2, my end result prints that value twice
def LoginIf():
Log.Message(Project.Variables.Instance_Alias_V, "")
if Project.Variables.Instance_Alias_V == "QAT1":
#pass
Log.Message("QAT1", "")
#if LastResult == True:
#pass
#EnterQ1.EnterQ1()
elif Project.Variables.Instance_Alias_V == "QAT2":
#pass
Log.Message("QAT2", "")
#EnterQ2.EnterQ2()
elif Project.Variables.Instance_Alias_V == "QAT5":
#pass
Log.Message("QAT5", "")
#EnterQ5.EnterQ5()