File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -409,6 +409,9 @@ public function selectOptionInRadioField($label, $option)
409409 /**
410410 * Selects an option in a Chosen Selector based on its label
411411 *
412+ * @param string $label The text in the <label> with for attribute that links to the <select> element
413+ * @param string $option The text in the <option> to be selected in the chosen selector
414+ *
412415 * @return void
413416 */
414417 public function selectOptionInChosen ($ label , $ option )
@@ -424,6 +427,25 @@ public function selectOptionInChosen($label, $option)
424427 $ I ->wait (1 ); // Gives time to chosen to close
425428 }
426429
430+ /**
431+ * Selects an option in a Chosen Selector based on its label
432+ *
433+ * @param string $selectId The id of the <select> element
434+ * @param string $option The text in the <option> to be selected in the chosen selector
435+ *
436+ * @return void
437+ */
438+ public function selectOptionInChosenById ($ selectId , $ option )
439+ {
440+ $ chosenSelectID = $ selectId . '_chzn ' ;
441+ $ I = $ this ;
442+ $ this ->debug ("I open the $ chosenSelectID chosen selector " );
443+ $ I ->click (['xpath ' => "//div[@id=' $ chosenSelectID']/a/div/b " ]);
444+ $ this ->debug ("I select $ option " );
445+ $ I ->click (['xpath ' => "//div[@id=' $ chosenSelectID']//li[text()=' $ option'] " ]);
446+ $ I ->wait (1 ); // Gives time to chosen to close
447+ }
448+
427449 /**
428450 * Selects one or more options in a Chosen Multiple Select based on its label
429451 *
You can’t perform that action at this time.
0 commit comments