Skip to content

Commit a1cd02b

Browse files
authored
Only wait when necessary (#326)
Only wait when necessary
1 parent 36c3358 commit a1cd02b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/Selenium2Driver.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -978,8 +978,11 @@ public function wait($timeout, $condition)
978978

979979
do {
980980
$result = $this->wdSession->execute(array('script' => $script, 'args' => array()));
981+
if ($result) {
982+
break;
983+
}
981984
usleep(10000);
982-
} while (microtime(true) < $end && !$result);
985+
} while (microtime(true) < $end);
983986

984987
return (bool) $result;
985988
}

0 commit comments

Comments
 (0)