Hey Siddhahrtha Thapa,
Why do you want to count the items in a dropdown?
var size = mtf.$('.mx-name-referenceSelector1 option').size();
This is JQuery code, for more information on JQuery you could take a look at: https://www.w3schools.com/jquery/jquery_ref_selectors.asp
Due to the .size() method you will get a number back, containing the size of your dropdown elements. To compare whether that size is as expected you could use the assert equal to action after that. For more information on how to use the debugger and create your JQuery code for ATS, you can take a look at the following documentation: https://docs.mendix.com/ats/howtos/ht-version-2/create-custom-actions-2
I hope this helps!
try this interactive...jQuery tutorial