How to validate sorting results using selenium webdriver?
it is a nice questions. However sorting strings is not something that Selenium will help you do. You can rely on the Programming languages constructs to do this task. For example in java we can do a Arrays.Sort to sort out a string array.
So what you have to do is
1. Get all the product names in an array(Array1)
2. Apply sort
3. Apply sort on the web application
4. Again get all the names in a different array (Array2)
5. Compare the 2 arrays.
If you application is doing a simple name sort this will work.