Quantcast
Channel: Silk Test - Forum - Recent Threads
Viewing all articles
Browse latest Browse all 625

how to create a switch statement if element exists

$
0
0

Hello everyone I wonder how to create a switch statement if an element exists.

 

in my case


I would like to check if the element exists
(desktop.<RumbaTextField>find("//RumbaTextField[@priorlabel='1']").exists())

if not switch to

(desktop.<RumbaTextField>find("//RumbaTextField[@priorlabel='2']").exists())

if not even that exists try 

(desktop.<RumbaTextField>find("//RumbaTextField[@priorlabel='3']").exists())

 

 

 

Error:

Cannot switch on a value of type boolean. Only convertible int values, strings or enum variables are permitted.

 

I have been looking on this example:

int number =2;switch(number){case0:
        System.out.println("zero");break;case1:
        System.out.println("one");break;case2:
        System.out.println("two");break;default:
        System.out.println("many");break;}



Could someone help me out?




Viewing all articles
Browse latest Browse all 625

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>