Test for space striping .label attribute of OPTION element On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". PASS o1.label is "text with extra while spaces" PASS o2.label is "text" PASS o3.label is " test text " PASS o4.label is "test  text" PASS successfullyParsed is true TEST COMPLETE text with extra while spaces text  test text  test  text