@@ -113,7 +113,6 @@ protected function obsoleteMethods()
113113
114114 // specific to Java SeleniumServer
115115 'file ' => array ('POST ' ),
116- 'log ' => array ('POST ' ),
117116 );
118117 }
119118
@@ -239,6 +238,7 @@ public function window()
239238
240239 // set focus
241240 $ arg = func_get_arg (0 ); // window handle or name attribute
241+
242242 if (is_array ($ arg )) {
243243 $ this ->curl ('POST ' , '/window ' , $ arg );
244244
@@ -286,6 +286,7 @@ public function frame()
286286 {
287287 if (func_num_args () === 1 ) {
288288 $ arg = func_get_arg (0 ); // json
289+
289290 $ this ->curl ('POST ' , '/frame ' , $ arg );
290291
291292 return $ this ;
@@ -307,6 +308,7 @@ public function timeouts()
307308 // set timeouts
308309 if (func_num_args () === 1 ) {
309310 $ arg = func_get_arg (0 ); // json
311+
310312 $ this ->curl ('POST ' , '/timeouts ' , $ arg );
311313
312314 return $ this ;
@@ -317,6 +319,7 @@ public function timeouts()
317319 'type ' => func_get_arg (0 ), // 'script' or 'implicit'
318320 'ms ' => func_get_arg (1 ), // timeout in milliseconds
319321 );
322+
320323 $ this ->curl ('POST ' , '/timeouts ' , $ arg );
321324
322325 return $ this ;
@@ -395,6 +398,34 @@ public function application_cache()
395398 return new ApplicationCache ($ this ->url . '/application_cache ' );
396399 }
397400
401+ /**
402+ * log methods: /session/:sessionId/log (POST)
403+ * - $session->log($type) - get log for given log type
404+ * - $session->log()->method() - chaining
405+ *
406+ * @return mixed
407+ */
408+ public function log ()
409+ {
410+ // get log for given log type
411+ if (func_num_args () === 1 ) {
412+ $ arg = func_get_arg (0 );
413+
414+ if (is_string ($ arg )) {
415+ $ arg = array (
416+ 'type ' => $ arg ,
417+ )
418+ }
419+
420+ $ this ->curl ('POST ' , '/log ' , $ arg );
421+
422+ return $ this ;
423+ }
424+
425+ // chaining
426+ return new Log ($ this ->url . '/log ' );
427+ }
428+
398429 /**
399430 * {@inheritdoc}
400431 */
0 commit comments