I am facing some problem in my goto function. I am assuming my goto function having alignment problem. I couldn’t set the Proper Alignment because I never used goto function before this…Please anybody help me…
If you know any other way please let me know your valuable commands…
This is my Script….
print("Navigation Was Successful")
print("ERROR: Navigation Verification")
[-] if AnalysisConsoleCopyright.Basefrm.ActualVsStandardC ostPerfor1.GetFullCaption()=="Actual vs Standard Cost Performance By Commodity"
print("Actual vs Standard Cost Performance By Commodity"+ Space (14) + "Pass")
print("Actual vs Standard Cost Performance By Commodity"+ Space (14) +"Fail")
AnalysisConsoleCopyright.Treeframe.ActualVsStandar dCostPerfor2.DoClick ()
if (Browser.IsDefined("Actual vs Standard Cost Performance By Organization"))
if AnalysisConsoleCopyright.Basefrm.ActualVsStandardC ostPerfor2.GetFullCaption()=="Actual vs Standard Cost Performance By Organization"
Please let me know your command…
I am not a Silktest person but I would suggest that you check the word "next" - in several programming languages I have worked with it is a reserved word and could not be used and an identifier for your "goto" command.
I would suggest that you avoid using the goto statement. In general it's considered bad form to use the goto when programming as it can make code hard to follow. I've never come across something that can't be done with if/else or function calls. In your case you already have the if/else structure so why don't you just move the code into the if/else block instead of using GOTO? If you want the code to be reusable you should make external methods and call them from your if/else block. Hope this helps, let me know if you need an example.
HI Thanks for your kindly replay. But I don’t know how to do that. So please give me some example…
Actually my projects concept is. I would explain that then only we can understand the necessary of goto function… Actually I have different server like x, z, y, w. But I have written the code defending upon the X server. Now the same code would run all servers without any modify the script. But some server having different option that’ why I have been use goto function but some times the goto function wouldn’t working properly…Now you tell me can I used your concept in my projects… If it’s possible please tell me some idea and sample code.
I am expecting mail form you…
The testcase has to go in a script file. The methods can go in either, though of course if you put them in an include file you will have to include that in your script file. Also, assuming that you are using Visual 4Test you won't need the curly braces but rather those sections should be indented.
On a related note if simple concepts like if/else structure and calling methods are difficult for you it might be worthwhile to take an intro programming course. It could go a long way towards making the 4Test language much easier to understand. Just my 2 cents. Hope this helps,