I need some help with figuring out how to handle the following situation:
I am trying to fill out a form and need to click the checkbox that relates to a certain string variable I have. Currently I have a sequence of 10 different “if” functions that use (variable.contains(“xyz”)). If none of these if functions return true I need it to click the “other” box and input the variable in that box.
Here is a rough idea of what I have:
if (variable.contains(“retail”)) - true(clicks retail box), else(continues on)
if (variable.contains(“construction”)) - true(clicks construction box), else(continues on)
if (variable.contains(“wholesale”)) - true(clicks wholesale box), else(continues on)
If none of the above return as true then I need to check the other box and input the variable. If one of them returns true I obviously don’t want to check other.
I have tried using the “try catch” function but I can’t put the other part under finally because then it will always check that box.
Appreciate the help!