Ask a Question

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


  /Alex [Community Hero]
[Community Heroes] 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. Posts made by [Community Heroes]
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.
The [Community Hero] signature is used with permission by SmartBear Software.
Showing results for 
Search instead for 
Did you mean: