NAME
WWW::WebKit - Perl extension for controlling an embedding WebKit engine
SYNOPSIS
use WWW::WebKit;
my $webkit = WWW::WebKit->new(xvfb => 1);
$webkit->init;
$webkit->open("http://www.google.com");
$webkit->type("q", "hello world");
$webkit->click("btnG");
$webkit->wait_for_page_to_load(5000);
print $webkit->get_title;
DESCRIPTION
WWW::WebKit is a drop-in replacement for WWW::Selenium using Gtk3::WebKit as browser instead of relying on an external Java server and an installed browser.
EXPORT
None by default.
init
Initializes Webkit and GTK3. Must be called before any of the other methods.
Implemented methods of the Selenium API
Please see WWW::Selenium for the full documentation of these methods.
set_timeout($timeout)
Set the default timeout to $timeout.
open($url)
refresh()
go_back()
get_xpath_count
select($select, $option)
click($locator)
check($locator)
uncheck($locator)
wait_for_page_to_load($timeout)
wait_for_element_present($locator, $timeout)
is_element_present($locator)
get_text($locator)
type($locator, $text)
type_keys($locator, $string)
pause($time)
is_ordered($first, $second)
get_body_text()
get_title()
mouse_over($locator)
mouse_down($locator)
fire_event($locator, $event_type)
get_value($locator)
get_attribute($locator)
is_visible($locator)
submit($locator)
get_html_source()
get_confirmation()
print_requested()
answer_on_next_prompt($answer)
Additions to the Selenium API
wait_for_element_to_disappear($locator, $timeout)
Works just like wait_for_element_present but instead of waiting for the element to appear, it waits for the element to disappear.
wait_for_alert($text, $timeout)
Wait for an alert with the given text to happen. If $text is undef, it waits for any alert. Since alerts do not get automatically cleared, this has to be done manually before causing the action that is supposed to throw a new alert:
$webkit->alerts([]);
$webkit->click('...');
$webkit->wait_for_alert;
native_drag_and_drop_to_object($source, $target)
Drag&drop that works with native HTML5 D&D events.
SEE ALSO
See WWW::Selenium for API documentation. See Test::WWW::WebKit for a replacement for Test::WWW::Selenium. See Test::WWW::WebKit::Catalyst for a replacement for Test::WWW::Selenium::Catalyst.
AUTHOR
Stefan Seifert, <nine@cpan.org>
COPYRIGHT AND LICENSE
Copyright (C) 2011 by Stefan Seifert
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.12.3 or, at your option, any later version of Perl 5 you may have available.