Forum Discussion
I do have a script listed in Project Explorer under <Project Suite> -> <Project Name> -> Advanced -> Script , but the "Run Script Routine", when selected, still presents "No tests were found in your project suite." message. Do I have the script routine located in the wrong directory or is there some environment variable needing added or configured?
socaltester wrote:
I do have a script listed in Project Explorer under <Project Suite> -> <Project Name> -> Advanced -> Script , but the "Run Script Routine", when selected, still presents "No tests were found in your project suite." message. Do I have the script routine located in the wrong directory or is there some environment variable needing added or configured?
The script in project explorer is a file that should contain functions, methods, etc. You can't just add a file. In that file, do you have method defined? (what code language are you using?)
For example, if you have a file that is JavaScript, you can't just do this:
//This is a script file var MyName = "Test"; Log.Message(MyName);
You need to put your code into a function:
//This is a script file function MyTest(){ var MyName = "Test"; Log.Message(MyName); }
Depending upon the language you're using the syntax may differ, but that's basically the problem.
- socaltester7 years agoContributor
I inherited a TC project based on VBScript. This is the code:
Set browser = Sys.WaitProcess("iexplore", 1000)
dw((browser.Exists))
browser.Terminate()
browser.Sys.WaitProcess("iexplore", 1000)
'dw' is a "do loop"
- socaltester7 years agoContributor
Okay. I think I got it working using your recommendation:
Function CloseIE()
Set browser = Sys.WaitProcess("iexplore", 1000)
do while((browser.Exists))
browser.Terminate()
browser.Sys.WaitProcess("iexplore", 1000)
loop
End Function
+++++++
It works, but when iexplore exists it terminate it and then throws an exception "Object Required" with line 3 highlighted as the culprit. [do while((browser.Exists))].
- tristaanogre7 years agoEsteemed Contributor
Change your code to
Function CloseIE() Set browser = Sys.WaitProcess("iexplore", 1000) do while((browser.Exists)) browser.Terminate() Set browser = Sys.WaitProcess("iexplore", 1000) loop End Function
Related Content
- 2 years agoianlop
- 11 months agoIso_Yura
- 6 months agomacheshmeh
- 6 years agovthomeschoolmom
Recent Discussions
- 2 days agoGane195