All Projects → teodesian → Selenium Remote Driver

teodesian / Selenium Remote Driver

Perl Bindings to the Selenium Webdriver server

Programming Languages

perl
6916 projects

Projects that are alternatives of or similar to Selenium Remote Driver

Csharp.webdriver
Browser test automation using Selenium WebDriver in C#
Stars: ✭ 115 (-31.95%)
Mutual labels:  selenium, selenium-webdriver
Marionette
Selenium alternative for Crystal. Browser manipulation without the Java overhead.
Stars: ✭ 119 (-29.59%)
Mutual labels:  selenium, selenium-webdriver
Moon
An efficient Selenium protocol implementation running everything in Kubernetes or Openshift
Stars: ✭ 116 (-31.36%)
Mutual labels:  selenium, selenium-webdriver
Whatsappbot
Send messages to any person in any time how much you want.
Stars: ✭ 104 (-38.46%)
Mutual labels:  selenium, selenium-webdriver
Ayespy
A performant visual regression testing tool
Stars: ✭ 150 (-11.24%)
Mutual labels:  selenium, selenium-webdriver
Frameworkium Core
Framework for writing maintainable Selenium and REST API tests in Java.
Stars: ✭ 107 (-36.69%)
Mutual labels:  selenium, selenium-webdriver
Selenium extensions
Tools that will make writing tests, bots and scrapers using Selenium much easier
Stars: ✭ 140 (-17.16%)
Mutual labels:  selenium, selenium-webdriver
Cabbie
WebDriver for the masses
Stars: ✭ 70 (-58.58%)
Mutual labels:  selenium, selenium-webdriver
Horn3t
Powerful Visual Subdomain Enumeration at the Click of a Mouse
Stars: ✭ 120 (-28.99%)
Mutual labels:  selenium, selenium-webdriver
30 Days Of Python
Learn Python for the next 30 (or so) Days.
Stars: ✭ 1,748 (+934.32%)
Mutual labels:  selenium, selenium-webdriver
Sillynium
Automate the creation of Python Selenium Scripts by drawing coloured boxes on webpage elements
Stars: ✭ 100 (-40.83%)
Mutual labels:  selenium, selenium-webdriver
Instagram Bot
An Instagram bot developed using the Selenium Framework
Stars: ✭ 138 (-18.34%)
Mutual labels:  selenium, selenium-webdriver
Webdriverextensions
Make your WebDriver based Selenium tests more readable, reusability and maintainable by using WebDriver Extensions!
Stars: ✭ 89 (-47.34%)
Mutual labels:  selenium, selenium-webdriver
Webium
Webium is a Page Object pattern implementation library for Python (http://martinfowler.com/bliki/PageObject.html). It allows you to extend WebElement class to your custom controls like Link, Button and group them as pages.
Stars: ✭ 144 (-14.79%)
Mutual labels:  selenium, selenium-webdriver
Cfselenium
A native Selenium WebDriver binding for ColdFusion
Stars: ✭ 77 (-54.44%)
Mutual labels:  selenium, selenium-webdriver
Seleniumcrawler
An example using Selenium webdrivers for python and Scrapy framework to create a web scraper to crawl an ASP site
Stars: ✭ 117 (-30.77%)
Mutual labels:  selenium, selenium-webdriver
Java.appium
Mobile test automation using Appium in Java
Stars: ✭ 59 (-65.09%)
Mutual labels:  selenium, selenium-webdriver
Pyleniumio
Bring the best of Selenium and Cypress into a single Python package
Stars: ✭ 61 (-63.91%)
Mutual labels:  selenium, selenium-webdriver
Webdrivermanager
WebDriverManager (Copyright © 2015-2021) is a project created and maintained by Boni Garcia and licensed under the terms of the Apache 2.0 License.
Stars: ✭ 1,808 (+969.82%)
Mutual labels:  selenium, selenium-webdriver
Java.webdriver
Browser test automation using Selenium WebDriver in Java
Stars: ✭ 135 (-20.12%)
Mutual labels:  selenium, selenium-webdriver

Selenium::Remote::Driver Build Status Coverage Status

WARNING

Selenium has essentially been leapfrogged technologically by Playwright. (using the devtools protocol for all browsers) Use Chrome::DevToolsProtocol instead of this unless you want to be frustrated by a tool which doesn't do half of what you want. Even then you are probably shooting yourself in the foot not using Javascript directly to automate the testing of webpages.

Introduction

Selenium WebDriver is a test tool that allows you to write automated web application UI tests in any programming language against any HTTP website using any mainstream JavaScript-enabled browser. This module is a Perl implementation of the client for the Webdriver JSONWireProtocol that Selenium provides.

It also implements WC3 selenium.

Installation

It's probably easiest to use the cpanm or CPAN commands:

$ cpanm Selenium::Remote::Driver

If you want to install from this repository, see the installation docs for more details.

Usage

You can use this module to directly start the webdriver servers, after downloading the appropriate ones and putting the servers in your $PATH. This method does not require the JRE/JDK to be installed, nor does it require the standalone server jar, despite the name of the module. In this case, you'll want to use the appropriate class for driver construction: either Selenium::Chrome, Selenium::Firefox, Selenium::PhantomJS, or Selenium::InternetExplorer.

You can also use this module with the selenium-standalone-server.jar to let it handle browser start up for you, and also manage Remote connections where the server jar is not running on the same machine as your test script is executing. The main class for this method is Selenium::Remote::Driver.

Regardless of which method you use to construct your browser object, all of the classes use the functions listed in the S::R::Driver POD documentation, so interacting with the browser, the page, and its elements would be the same.

no standalone server

  • Firefox 48 & newer: install the Firefox browser, download geckodriver and put it in your $PATH. If the Firefox browser binary is not in the default place for your OS and we cannot locate it via which, you may have to specify the binary location during startup. We also will need to locate the Firefox browser; if the Firefox browser isn't in the default location, you must provide it during startup in the firefox_binary attr.

  • Firefox 47 & older: install the Firefox browser in the default place for your OS. If the Firefox browser binary is not in the default place for your OS, you may have to specify the firefox_binary constructor option during startup.

  • Chrome: install the Chrome browser, download Chromedriver and get chromedriver in your $PATH.

  • PhantomJS: install the PhantomJS binary and get phantomjs in your $PATH. The driver for PhantomJS, Ghostdriver, is bundled with PhantomJS.

When the browser(s) are installed and you have the appropriate binary in your path, you should be able to do the following:

my $firefox = Selenium::Firefox->new;
$firefox->get('http://www.google.com');

my $chrome = Selenium::Chrome->new;
$chrome->get('http://www.google.com');

my $ghost = Selenium::PhantomJS->new;
$ghost->get('http://www.google.com');

Note that you can also pass a binary argument to any of the above classes to manually specify what binary to start. Note that this binary refers to the driver server, not the browser executable.

my $chrome = Selenium::Chrome->new(binary => '~/Downloads/chromedriver');

See the pod for the different modules for more details.

Breaking Changes for Selenium::Firefox in v1.0+

There are breaking changes for Selenium::Firefox from v0.2701 of S:F to v1.0+. This is because in FF47 and older, Firefox didn't have a separate webdriver server executable - local startup was accomplished by starting your actual Firefox browser with a webdriver extension. However, in FF48 and newer, Mozilla have switched to using geckodriver to handle the Webdriver communication. Accordingly, v1.0+ of Selenium::Firefox assumes the geckodriver setup which only works for FF48 and higher:

# marionette_enabled defaults to 1 === assumes you're running FF48
my $fx48 = Selenium::Firefox->new;
my $fx48 = Selenium::Firefox->new( marionette_enabled => 1 );

To drive FF47 with v1.0+ of Selenium::Firefox, you must manually disable marionette:

my $fx47 = Selenium::Firefox->new( marionette_enabled => 0 );

Doing so will start up your Firefox browser with the webdriver extension. Note that in our tests, doing the old "webdriver-extension-startup" for Firefox 48 does not work. Likewise, geckodriver does not work with FF47.

with a standalone server

Download the standalone server and have it running on port 4444:

$ java -jar selenium-server-standalone-X.XX.X.jar

As before, have the browsers themselves installed on your machine, and download the appropriate binary server, passing its location to the server jar during startup.

Locally

use strict;
use warnings;
use Selenium::Remote::Driver;

my $driver = Selenium::Remote::Driver->new;
$driver->get('http://www.google.com');
print $driver->get_title . "\n"; # "Google"

my $query = $driver->find_element('q', 'name');
$query->send_keys('CPAN Selenium Remote Driver');

my $send_search = $driver->find_element('btnG', 'name');
$send_search->click;

# make the find_element blocking for a second to allow the title to change
$driver->set_implicit_wait_timeout(2000);
my $results = $driver->find_element('search', 'id');

print $driver->get_title . "\n"; # CPAN Selenium Remote Driver - Google Search
$driver->quit;

Saucelabs

If using Saucelabs, there's no need to have the standalone server running on a local port, since Saucelabs provides it.

use Selenium::Remote::Driver;

my $user = $ENV{SAUCE_USERNAME};
my $key = $ENV{SAUCE_ACCESS_KEY};

my $driver = Selenium::Remote::Driver->new(
    remote_server_addr => $user . ':' . $key . '@ondemand.saucelabs.com',
    port => 80
);

$driver->get('http://www.google.com');
print $driver->get_title();
$driver->quit();

There are additional usage examples on metacpan, and also in this project's wiki, including setting up the standalone server, running tests on Internet Explorer, Chrome, PhantomJS, and other useful example snippets.

Selenium IDE Plugin

ide-plugin.js is a Selenium IDE Plugin which allows you to export tests recorded in Selenium IDE to a perl script.

Installation in Selenium IDE

  1. Open Selenium IDE
  2. Options >> Options
  3. Formats Tab
  4. Click Add at the bottom
  5. In the name field call it 'Perl-Webdriver'
  6. Paste this entire source in the main textbox
  7. Click 'Save'
  8. Click 'Ok'
  9. Close Selenium IDE and open it again.

Note: The Code generated by this plugin currently assumes that you have firefox 48 or newer + the geckodriver plugin installed.

If you have an older version of firefox you can adjust the plugin the following way: In the options window of selenium IDE (Formats tab) there is a input box called "Header". Here you can modify the fixed header code beeing generatd. Change Selenium::Firefox->new(); according to the firefox init examples shown above in this README.

Support and Documentation

There is a mailing list available at

https://groups.google.com/forum/#!forum/selenium-remote-driver

for usage questions and ensuing discussions. If you've come across a bug, please open an issue in the Github issue tracker. The POD is available in the usual places, including metacpan, and in your shell via perldoc.

$ perldoc Selenium::Remote::Driver
$ perldoc Selenium::Remote::WebElement

Contributing

Thanks for considering contributing! The contributing guidelines are in the wiki. The documentation there also includes information on generating new Linux recordings for Travis.

Copyright and License

Copyright (c) 2010-2011 Aditya Ivaturi, Gordon Child

Copyright (c) 2014-2017 Daniel Gempesaw

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].