… | |
… | |
224 | (currently the session id and capabilities), not the endpoint information |
224 | (currently the session id and capabilities), not the endpoint information |
225 | itself. |
225 | itself. |
226 | |
226 | |
227 | The main use of this function is in conjunction with disabled |
227 | The main use of this function is in conjunction with disabled |
228 | C<autodelete>, to save a session to e.g., and restore it later. It could |
228 | C<autodelete>, to save a session to e.g., and restore it later. It could |
229 | presumably used for other applications, suhc as using the same sssion from |
229 | presumably used for other applications, such as using the same session |
230 | multiple processes and so on. |
230 | from multiple processes and so on. |
231 | |
231 | |
232 | =item $wd->load_session ($sessionstring) |
232 | =item $wd->load_session ($sessionstring) |
233 | |
233 | |
234 | =item $wd->set_session ($sessionid, $capabilities) |
234 | =item $wd->set_session ($sessionid, $capabilities) |
235 | |
235 | |
… | |
… | |
304 | successfully, and only one session can be created per WebDriver object. |
304 | successfully, and only one session can be created per WebDriver object. |
305 | |
305 | |
306 | On success, C<< $wd->{sid} >> is set to the session ID, and C<< |
306 | On success, C<< $wd->{sid} >> is set to the session ID, and C<< |
307 | $wd->{capabilities} >> is set to the returned capabilities. |
307 | $wd->{capabilities} >> is set to the returned capabilities. |
308 | |
308 | |
309 | Simple example of creatring a WebDriver object and a new session: |
309 | Simple example of creating a WebDriver object and a new session: |
310 | |
310 | |
311 | my $wd = new AnyEvent::Selenium endpoint => "http://localhost:4545"; |
311 | my $wd = new AnyEvent::Selenium endpoint => "http://localhost:4545"; |
312 | $wd->new_session ({}); |
312 | $wd->new_session ({}); |
313 | |
313 | |
314 | Real-world example with capability negotiation: |
314 | Real-world example with capability negotiation: |
… | |
… | |
538 | $_[0]->post_ ("frame/parent" => undef, $_[1]); |
538 | $_[0]->post_ ("frame/parent" => undef, $_[1]); |
539 | } |
539 | } |
540 | |
540 | |
541 | =item $rect = $wd->get_window_rect |
541 | =item $rect = $wd->get_window_rect |
542 | |
542 | |
543 | Return the current window rect, e.g.: |
543 | Return the current window rect(angle), e.g.: |
544 | |
544 | |
545 | $rect = $wd->get_window_rect |
545 | $rect = $wd->get_window_rect |
546 | => { height => 1040, width => 540, x => 0, y => 0 } |
546 | => { height => 1040, width => 540, x => 0, y => 0 } |
547 | |
547 | |
548 | =item $wd->set_window_rect ($rect) |
548 | =item $wd->set_window_rect ($rect) |
549 | |
549 | |
550 | Sets the window rect. |
550 | Sets the window rect(angle). |
551 | |
551 | |
552 | =cut |
552 | =cut |
553 | |
553 | |
554 | sub get_window_rect_ { |
554 | sub get_window_rect_ { |
555 | $_[0]->get_ ("window/rect" => $_[1]); |
555 | $_[0]->get_ ("window/rect" => $_[1]); |
… | |
… | |
1456 | $self |
1456 | $self |
1457 | } |
1457 | } |
1458 | |
1458 | |
1459 | =item $al->perform ($wd) |
1459 | =item $al->perform ($wd) |
1460 | |
1460 | |
1461 | Finaluses and compiles the list, if not done yet, and calls C<< |
1461 | Finalises and compiles the list, if not done yet, and calls C<< |
1462 | $wd->perform >> with it. |
1462 | $wd->perform >> with it. |
1463 | |
1463 | |
1464 | If C<$wd> is undef, and the action list was created using the C<< |
1464 | If C<$wd> is undef, and the action list was created using the C<< |
1465 | $wd->actions >> method, then perform it against that WebDriver object. |
1465 | $wd->actions >> method, then perform it against that WebDriver object. |
1466 | |
1466 | |