File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -196,6 +196,8 @@ public function touch() {
196196 public function switch_to_frame ($ frame = null , $ curl_opts = array ()) {
197197 if (is_a ($ frame , "PHPWebDriver_WebDriverElement " )) {
198198 $ frame_id = array ("id " => array ("ELEMENT " => $ frame ->getId ()));
199+ } elseif ($ frame == null ) {
200+ $ frame_id = null ;
199201 } else {
200202 throw new InvalidArgumentException ('$frame needs to be a webdriver element of a frame ' );
201203 }
@@ -243,4 +245,4 @@ protected function getElementPath($element_id) {
243245 return sprintf ('%s/element/%s ' , $ this ->url , $ element_id );
244246 }
245247}
246- ?>
248+ ?>
Original file line number Diff line number Diff line change @@ -26,6 +26,6 @@ public function test_frame_stuff() {
2626 $ ps = self ::$ session ->elements ("css selector " , "p " );
2727 $ this ->assertEquals (count ($ ps ), 6 );
2828 // switch back
29- self ::$ session ->frame ();
29+ self ::$ session ->switch_to_frame ();
3030 }
3131}
You can’t perform that action at this time.
0 commit comments