Forum Discussion

dmitri_1's avatar
dmitri_1
Occasional Contributor
11 years ago

Using If...Then Statements

I have tried using If...Then, Else statements.



This didn't work unfortunately.



If i understood it correctly, the if condition simply cannot evaluate if the element is not there, thus it can't continue onto the Else.



Attaching screenshot of the setup.





Basic idea of the test  - IF you are on a particular tab THEN click the desired tab. ELSE just continue with the test.

Also can you keep chaining ELSE IF's together?

Would have been easier if you guys just had a case statement which vbscript has...
  • It seems there are not a lot of unique properties on the java process. The only thing I can see is to exclude Eclipse from matching.



    In the "CommandLine" process property there is reference to "eclipse". Just make sure you exclude that.



    See attached screenshot.
  • maximojo's avatar
    maximojo
    Frequent Contributor
    What process properties are you attempting to map with?



    The name only? How did you try to map it?



    Any other properties?
  • dmitri_1's avatar
    dmitri_1
    Occasional Contributor
    Yes just the name, I don't really know what the other ones are or how to use them.





    Basically my problem is, I have a java application. If nothing else is running, the tests run fine. If eclipse IDE is running at the same time, then the tests fail.





    Can you tell me what/how to map in order to avoid this please.
  • dmitri_1's avatar
    dmitri_1
    Occasional Contributor
    Now it's somehow gotten completely broken and thinks javaw2 doesn't exist, so no tests can run :(
  • dmitri_1's avatar
    dmitri_1
    Occasional Contributor
    Thanks, yeah I figured that out myself eventually (after about an hour of trial and error).



    More importantly in my case is I just say command line contains *C:\application directory* and that makes sure it only looks at the application I want, and not any others (because the same app may run multiple instances from different locations).