How to verify that the table has been correctly sorted in Codeception? -
how can test order of rows in html table correct, after "clicking" table column caption sort table?
it should this:
*assuming table has 1 column
$elements = $this->elements($this->using('xpath')->value("//div[@id='row']/div")); //identifying row element $rows = count($elements); //count number of rows $unsortedrow = []; $unsortedrows = [] for($count=0;$count<$rows;$count++){ // values in unsorted table $unsortedrow[$count] = $i->grabtextfrom('//div[@id='main_body']/div/div['.$count.']/div/strong'); // text row array_push($unsortedrows, $unsortedrow[$count]); // push value of row n rows array } note: $this->elements() , count() proven working in selenium 2 don't know if in codeception, according of articles i've read seenumberofelements alternative that.
Comments
Post a Comment