Showing results for 
Search instead for 
Did you mean: 

Switch Case for Dropdown Selection Issue

Community Hero

Re: Switch Case for Dropdown Selection Issue



> if (!navigate.WaitAliasChild('carrier', 5000).Width == 0 || navigate.WaitAliasChild('carrier', 5000).Exists)

> because you're calling code in your IF clause for an object that might not exist yet.

If you don't like nested conditions, you may use the fact that JScript uses short circuit conditionals. The code in this case may look like this:

if ((navigate.WaitAliasChild('carrier', 5000).Exists) && (navigate.carrier.Width > 0))

  // sucess


  // failure


[Community Expert Group]
[Community Expert Group] members are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Postings made by [Community Expert Group] members
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
[Community Expert Group] signature is used with permission by SmartBear Software.
New Here?
Join us and watch the welcome video:
Top Kudoed Authors