Giter VIP home page Giter VIP logo

selenium-remote-driver's Introduction

I am a software engineer and tester available for Freelance and Consulting work through my firm Troglodyne, LLC

I have 15 years of experience writing and testing web applications with aparticular focus on web hosting, performance and mathematics.

Contact Information

Experience

If you prefer a more traditional resume/cv, see here. Alternatively, check me out on LinkedIn.

CEO, Troglodyne LLC

August 2020 - Present

I assist clients with all manner of software projects from my office in Houston. Primarily perl, html/css/js work, but the occasional PHP work thrown in too. I also build open source software for automated testing (see my pinned repos below), and am working on my own testing SAAS offering to be out early 2022. Recent and ongoing clients include:

I also do a youtube series on topics of interest to the software developer and tester.

Senior Tester, Senior Developer @ cPanel

July 2011-November 2012 and June 2014-August 2020 (Just shy of 8 years)

Senior QA for 5 of those years, moved onto development and was promoted in short order. Highlights:

  • Built a testing VM orchestration solution based on OpenStack
  • Built the majority of perl libraries used for automated acceptance testing used at cPanel
  • Optimized the performance of various database projects at cPanel
  • Did a number of user interface projects both using jQuery and Angular.
  • Fixed more bugs than I can remember, many having to do with RPMs and packaging

Senior Developer @ HailStrike.com

November 2012 - May 2014 (2 years)

Helped out my cousin with his startup until it nearly collapsed due to mismanagement. Highlights:

  • Built a multi-terabyte multi-shard postgres database for querying geospatial data across many years
  • Completely re-worked a PHP single page app from a prototype-in-production into ship-shape
  • Fielded calls and more or less kept the technical end of the business running during the firm's crisis. Boy have I got some stories.

QA Engineer @ Texas Instruments

July 2007 - May 2011 (4 Years)

My first job out of college with a Mathematics degree was to test calculators. I quickly learned automation and programming was the way to go. Highlights:

  • Testing applications written in assembly for 4-bit Toshiba microprocessors (and other obsolete hardware), we went as low level as you can imagine.
  • Tested higher-order java applications running emulators of said calculators (and one Computer Algebra System on a stick called the n-spire)
  • Ported the TI-84 emulator to linux (C++ and JNIlib)
  • Writing incredible amounts of python testing libraries for RobotFramework and other testing frameworks

Education and Skills

  • Ability to plan, create, modify, debug and deploy web applications using perl, PHP, javascript and Python
  • Ability to test pretty much any software, and teach others how to
  • BS in Mathematics from Southeastern Oklahoma State University (2005-2007)
  • ASTQB Certified Tester (Advanced Level) with Test Automation specialty Cert #15-CTAL-TA-00084-USA

Links:

Testimonials

Bryan S, Katz - Owner & Software Architect of Holophrastic Enterprises

I planned three months for a complete overhaul and migration of the entire business, expecting reality to drag it out. There were the peculiarities of my custom platform, the quirks of plesk, and the all-out fun of mixing the two with a completely new network architecture. I got far more, from George, than I understood was even possible. George worked through it all, filled in the blanks that I never knew I had, and simplified the parts that I'd over-complicated. He kept us "up-schedule" at every stage; we were done two-weeks early. George's experience with the nitty-gritty of plesk's internals, and his skills at lower-level linux, are the benefits that I can appreciate. His skills at the networking and virtualization levels are beyond my comprehension; I just get to watch it all work smoothly. George makes working with him very easy, which is why I continue to do so; I feel comfortable depending on his expertise for many aspects of my business. I now base my business on George's decisions, and will continue to depend on his dedication for many years to come.

Rikus Goodell - Senior Developer at cPanel

During his years at cPanel, George built up many of the tools that continue to power the QA department to this day, especially in automation of the Perl-based QA test suite and the VMs on which it runs. I would describe him as a pioneer of the group who helped make it possible for dozens of others to do their jobs efficiently. After he moved to a product developer role, I got the chance to work with him on a daily basis as part of a Scrum team, and I enjoyed having him as a teammate. One pattern he consistently shows is a relentless drive to solve problems, by whichever means fits the best in the situation. As a primary author of much of our test automation code, he is also no stranger to tackling large challenges single-handedly, and I find this independent mindset to be one of his most admirable qualities. Whether something needs to be fixed or something needs to be built from the ground up, George will make it happen.

David Lanning - Senior QA at cPanel

After working with George closely for years - not only did he help me grow Professionally - He also set an example I took home with me having the effect of making me a better person myself. Technically there was never a scenario I witnessed George not handle effectively, precisely, and thoroughly. Any endeavor he chooses to undertake would serve everyone well to pay attention.

selenium-remote-driver's People

Contributors

aivaturi avatar amacleay avatar andyjack avatar areyoutoo avatar autarch avatar basbloemsaat avatar bschmalhofer avatar gempesaw avatar gerhardj avatar gordolio avatar jamadam avatar kablamo avatar lembark avatar markstos avatar mgruner avatar mk654321 avatar mpspahr avatar peroumal1 avatar phil-kania avatar prateek88 avatar rouzier avatar syspete avatar szabgab avatar teodesian avatar tod222 avatar tomhukins avatar vitstradal avatar vkatsikaros avatar ylavoie avatar yuki-kimoto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

selenium-remote-driver's Issues

How to send a firefox command line option?

I want to specify a height and width for firefox to open with so from the command line it would be like this:

"C:\Program Files\Mozilla Firefox\firefox.exe" -height 1280 width 1020

You have an example of how to pass a command line option for chrome:

'extra_capabilities' => {'chrome.switches' => ["--user-data-dir=$ENV{LOCALAPPDATA}\Google\Chrome\User Data"],},

But how would you do this in firefox?

communicate direct with webdrivers, without java server?

This is more of a question than an issue, so if I'm asking in the wrong place, please let me know.

Here's my question -- is it possible to use Selenium::Remote::Driver to communicate directly with browsers? Or do you always have to go through the java-based selenium server?

To clarify, on the selenium docs pages (http://seleniumhq.org/docs/03_webdriver.html), it says this:

If you will be only using the WebDriver API you do not need the Selenium-Server. If your browser and tests will all run on the same machine, and your tests only use the WebDriver API, then you do not need to run the Selenium-Server; WebDriver will run the browser directly.

But it seems like the Selenium::Remote::Driver docs always talk about starting the server. In certain cases it would be more convenient to go direct to the browsers if possible, hence my question.

Thanks in advance for any responses and for the work on the perl bindings in general.

click in Selenium::Remote::Driver produces invalid JSON

click in class Selenium::Remote::Driver produces invalid JSON as noted in Selenium Server log:

11:33:20.897 INFO - WebDriver remote server: Fatal, unhandled exception: /session/1324545212079/click: org.openqa.selenium.remote.JsonException: org.json.JSONException: A JSONObject text must begin with '{' at character 1
Build info: version: '2.15.0', revision: '15105', time: '2011-12-08 09:56:25'
System info: os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.6.8', java.version: '1.6.0_29'
Driver info: driver.version: unknown

RemoteConnection gets invalid JSON back:

Failed to click mouse button: malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "nn<title...") at /Library/Perl/5.10.0/Selenium/Remote/RemoteConnection.pm line 77, <$fh> line 1.

Below is part of the code that produces the error:

use Selenium::Remote::Driver;

my $driver;
eval { $driver = new Selenium::Remote::Driver; };
if ($@) {
sleep 10;
$driver = new Selenium::Remote::Driver;
}
$driver->get('http://10.80.10.227:8042');

my $map;
eval { $map = $driver->find_element('//*[@Class="olMap"]'); };
if ($@) {
die "Failed to find map: $@";
}
eval { $driver->move_to( element => $map ); };
if ($@) {
die "Failed to move to map: $@";
}
eval { $driver->click() };
if ($@) {
die "Failed to click mouse button: $@";
}

hover: Error while executing command: Server returned error code 404 and no data

hover does not seem to work even though the element seems to be found all right and click on the same element works.

hover: Error while executing command: Server returned error code 404 and no data at /Library/Perl/5.10.0/Selenium/Remote/WebElement.pm line 39

Selenium::Remote::Driver version 0.12. Mac OS X 10.6.8. Firefox 8.0.1.

    my $element;
    eval {
        $element = $driver->find_element("//descendant::img[contains(\@src,'map-pin_big_')][$index]");
    };
    if ($@) {
        diag("Could not find image: $@");
        last;
    }
    eval {
        $element->hover();
    };
    if ($@) {
        diag("hover: $@");
        exit 1;
    }

Select Item from a drop down list

What is the function for selecting an item from a dropdown list based on the actual text of the item to be select.

I'm looking for something similar the following available in the Python WebDriver, for selecting the item called 'Evergreen' from a dropdown element called 'Plants'

Select(driver.find_element_by_name("Plants")).select_by_visible_text("Evergreen")

add 'webelement_class' option to new()

Test::WebDriver could usefully sub-class our 'WebElement' class to add more testing methods to it. However, that class is created within our find_element() call.

This issue can be addressed through the Dependency Injection pattern, by adding a webelement_class option to the Selenium::Remote::Driver constructor. The Test::WebDriver subclass could then set it's own Test-centric webelement class as a new default "web element" class. Particular projects may further sub-class Test::WebDriver and may wish to extend the "web element" object as well, providing an additional use-case for the feature.

enhancement for find_element to be able to search by value

I had a hard time looking up an element in a drop-down list by value attribute. I tried using find_element and find_child_element by specifying the value attribute but it did not work.

Finally, Selenium::WWW::select($select_locator, $option_locator) did the trick for me.
http://search.cpan.org/~mattp/Test-WWW-Selenium-1.35/lib/WWW/Selenium.pm

I would like to suggest this enhancement to the current api for Selenium::Remote::Driver to add this functionality . If it already exists in some way, please enlighten me !!

However, I could not figure out a way to do so.

Code I used:

my $mouse = $driver->find_element('//*[@id="blah"]');           
$mouse->click;

my $child = $driver->find_child_element($mouse,"value=7383");   
$child->click;

Thanks !

malformed JSON string, neither array, object, number, string or atom, at charact er offset 0 (before "<html>\n<head>\n<tit...") at C:/Perl/site/lib/Selenium/Remo te/RemoteConnection.pm line 95.

Selenium::Remote::Driver version 0.15-2

The error

'malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "\n\n<tit...") at C:/Perl/site/lib/Selenium/Remote/RemoteConnection.pm line 95.'

started to be displayed, during a new page download, on a site that was working fine before.

The line where the error is reported is in the '_process_response' subroutine of RemoteConnection.pm module:

line 95 : $decoded_json = $json->allow_nonref(1)->utf8(1)->decode($response->content);

Any suggestion on how this can be resolved. I'm using the latest remotedriver & JSON modules & Selenium server.

Thanks

synopsis could also have additional examples on how to search for elements and interact with them.

  1. The current documentation for module states that each call from $driver returns a hashref. That is no longer the case now. Documentation should be updated to show this.
  2. The synopsis could also have additional examples on how to search for elements and interact with them.
  3. Instructions on how to import and use the ide-plugin.js in the Selenium-IDE would be handy as well. This will allow someone to have access to the Selenium::Remote::Driver grammer in the Selenium-IDE. Until such a time when we can get the ide-plugin put in to the Selenium-IDE project.

WebElement is hardcoded as the element object to use with Selenium::Remote::Driver

Test::WebDriver sub-classes Selenium::Remote::Driver and would like to use it's own "WebElement" class with it.

Such uses are currently complicated by hardcoding the expected WebElement class to use. For example here, instead of using an "isa()" check, the class is hardcoded:

  if (ref $args[$i] eq 'Selenium::Remote::WebElement') {

And here, instead of using the class name passed in, the class is hardcoded:

  new Selenium::Remote::WebElement( $ret->{ELEMENT}, $self);

This is an issue in execute_async_script, execute_async_script and _convert_to_web_element.

Click

Hi,

I am working on a website to automate it using selenium IDE and selenium 2 with perl bindings developed by my company.
I am facing a problem with click function in IDE.

The thing is the all the functions like typing into the textbox and logging in, etc is fine. But, after I logon there will be a menu opened in which I click add-user button. This is recorded as click in the IDE. AfterI click a new window opens in the same site. Till, here my recording is done.

But, when I playback what I have recorded the click function gets executed but the window is not opening in the site.
I have tried the work around for this issue like inserting new commands to verify that after I logon to check the elements in the menu using waitfortext, waitforelementpresent, verifytext. But this is not working. All the xpath,css is given correctly but I am unable to solve it.

Can anyone give me some suggestions on how to do solve this issue.

$driver->click() doesn't work, patch included

Hi!

Thanks for creating this module, it's a lifesaver!

I found a bug when trying to open a dropdown selection in order to generate a screenshot:

$driver->move_to(element => $driver->find_element("//select[\@id='filterflags']","xpath"));
$driver->click();

The click died with an error:

 malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "<html>\n<head>\n<tit...") at /usr/local/share/perl/5.14.2/Selenium/Remote/RemoteConnection.pm line 90.

I changed the code to improve error reporting, on line 90 of RemoteConnection.pm:

            if ($response->content =~ m/^<html>/i) {
              $data->{'cmd_return'} = 'Server returned error message '.$response->content.' instead of data';
              return $data;
            }

It turned out there was a typo in click(), on line 1699 of Driver.pm. New code:

    return $self->_execute_command($res,$params);

The old code was:

     return $self->_execute_command($res,$button);

I don't know why click() was still working for elements, but those are still working after the change.

Enjoy!

missing commands

These are outlined in t/03-spec-coverage.t
I have placed them in this issue for anyone who is looking for a TODO item.

GET session/:sessionId/orientation
POST session/:sessionId/orientation
GET session/:sessionId/alert_text
POST session/:sessionId/alert_text
POST session/:sessionId/accept_alert
POST session/:sessionId/dismiss_alert
POST session/:sessionId/click
POST session/:sessionId/buttondown
POST session/:sessionId/buttonup
POST session/:sessionId/doubleclick

Tests failing

I am trying to install version 0.17 with Perl 5.18 on linux with CPAN but tests are failing with the following:

Running make test
PERL_DL_NONLAZY=1 /opt/synadmin/perl5/perlbrew/perls/perl-5.18.0/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00-load.t .................. ok
Could not create new session: Server returned error message Request information has changed since recording... do you need to record webdriver responses again? at t/lib/MockSeleniumWebDriver.pm line 65.
instead of data at t/01-driver.t line 51.

Tests were run but no plan was declared and done_testing() was not seen.

t/01-driver.t ................
Dubious, test returned 255 (wstat 65280, 0xff00)
All 1 subtests passed
Could not create new session: Server returned error message Request information has changed since recording... do you need to record webdriver responses again? at t/lib/MockSeleniumWebDriver.pm line 65.
instead of data at t/02-webelement.t line 51.

Tests were run but no plan was declared and done_testing() was not seen.

t/02-webelement.t ............
Dubious, test returned 255 (wstat 65280, 0xff00)
All 1 subtests passed
t/03-spec-coverage.t ......... skipped: Author tests not required for installation.
t/04-commands-implemented.t .. skipped: Author tests not required for installation.
t/manifest.t ................. skipped: Author tests not required for installation
t/pod.t ...................... skipped: Author tests not required for installation

Grid2 webdriver : only firefox working

'lo all,

I've set up a grid on Windows7 32 bit as such, all webdriver executables are either in the %SELENIUM% path, or in the global %PATH%...

set SELENIUM=c:\ESO\SE\server
cd %SELENIUM%
start java -jar selenium-server-standalone-2.26.0.jar -role hub
start java -Dwebdriver.chrome.driver="chromedriver.exe" -Dwebdriver.ie.driver="IEDriverServer.exe" -jar selenium-server-standalone-2.26.0.jar -ensureCleanSession -multiWindow -trustAllSSLCertificates -role node -hub http://localhost:4444/grid/register

With "firefox" the .pl scripts work fine, but when I try to run the same test-script with "browser_name => "chrome", the grid console spews out following error :

14:58:08.426 INFO - Executing: [new session: {platform=ANY, acceptSslCerts=true,
javascriptEnabled=true, browserName=chrome, proxy=null, version=}] at URL: /ses
sion)
Started ChromeDriver
port=42211
version=20.0.1133.0
log=c:\ESO\SE\server\chromedriver.log
14:58:08.988 WARN - Exception thrown
java.util.concurrent.ExecutionException: org.openqa.selenium.WebDriverException:
java.lang.reflect.InvocationTargetException
Build info: version: '2.26.0', revision: '18041', time: '2012-11-01 19:33:38'
System info: os.name: 'Windows 7', os.arch: 'x86', os.version: '6.1', java.versi
on: '1.7.0_09'
Driver info: driver.version: unknown
at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)

....

the chromedriver.log doesn't have any error in it ...

Any pointers please ?

grtz,
Gert

Sample script for Selenium::Remote::Driver

Hi,

Could anyone give me a sample script using Selenium::Remote::Driver to do basic test like filling up the textbox and submit to move to a new page, etc.

I wanted this because I found some commands like click, type etc. are missing in the module.

Regards,
Anurag

upload_file(): needs unit tests, and version check

upload_file() needs unit tests, and needs to check that Selenium is at least 2.8.0, as it doesn't work on older versions. Original ticket context follows.


Java and Ruby client libraries for Selenium Remote Driver have a feature for uploading a file to the host that runs the selenium server. According to this blog post, Selenium server has this feature since version 2.8.0:
http://sauceio.com/index.php/2012/03/selenium-tips-uploading-files-in-remote-webdriver/

The file is uploaded via the /session/:sessionId/file request, which is not documented in JSONWireProtocol, or anywhere else, actually. But the functionality is essential for file upload tests in case you use a 'Selenium-on-demand' service, like the one provided by Sauce Labs.

We could implement an upload_file() method in the Selenium::Remote::Driver class. The method could issue the session/:sessionId/file request (passing the file contents encoded as expected by the server), and would return the remote server's local path to the file uploaded. That path could then be used for a send_keys() call on a correct input element.

My take on how this could be implemented is in the following commit:
kurmanka@402a0a5

port "wait_for..." methods from WWW::Selenium

WWW::Selenium contains several useful "wait_for__" methods. With such methods, you might "sleep" much longer than you need to, just to be sure some element has appeared on the page when you go to look for it. With the "wait_for__" methods, the methods return as soon as some condition is true, but they still have timeouts built-in, so that they will eventually die instead of hanging indefinitely waiting.

Implementing these methods will also ease the work for those porting scripts over from WWW::Selenium. Here are the methods in this category that I recommend porting:

$sel->wait_for_pop_up($window_id, $timeout)
$sel->wait_for_condition($script, $timeout)
$sel->wait_for_page_to_load($timeout)
$sel->wait_for_frame_to_load($frame_address, $timeout)
$sel->wait_for_text_present($text, $timeout)
$sel->wait_for_element_present($locator, $timeout)

The original ticket description follows, which is a case that would have been helped out by the presence of a "wait_for_*" method.


I have found myself in a situation where selenium-server returns an "Element is not clickable at point..." error:

Element is not clickable at point (568, 276.5). Other element would receive the click:

The problem is that this div is used surrounding a lightview window which I close after filling some inputs. However, when I try to click a link behind this layer it haven't disappeared due to a fade effect.

Then, is_displayed and is_enabled return true, because the layer has transparency and the link is enabled, so I can't use this methods to wait for the element to be clickable. As it throw a different error in this situation, I was wondering if there are some way to "catch" it or to implement the is_clickable functionality. I have found some solutions in JAVA but not in perl.

Thanks in advance.
Miguel

Click

http://pastebin.com/ghN6Wa89
Line 381 the request is an empty contact body (3 bytes) it should be sending data in the form of a json object .
The result is when I ran the function click I would receive
"malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "\n\n<tit...") at /usr/local/share/perl/5.10.1/Selenium/Remote/RemoteConnection.pm line 77."

Send_keys(integer) doesn't work.

I found that
$driver->find_element('serial_id','name')->send_keys(567);
fails with the message
malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "\n\n<tit...") at /usr/local/share/perl/5.14.2/Selenium/Remote/RemoteConnection.pm line 90.

And with strace I found that the selenium server is reporting:
"POST /wd/hub/session/d5141551-2749-4df7-bd54-d24d9ac1791d/element/7/value HTTP/1.1\r\nTE: deflate,gzip;q=0.3\r\nConnection: TE, close\r\nAccept: application/json\r\nHost: localhost:4444\r\nUser-Agent: libwww-perl/6.03\r\nContent-Type: application/json; charset=utf-8\r\nContent-Length: 15\r\n\r\n{"value":[567]}"

HTTP/1.1 500 org%2Eopenqa%2Eselenium%2EWebDriverException%3A+java%2Elang%2EClassCastException%3A+java%2Elang%2ELong+cannot+be+cast+to+java%2Elang%2EString%0ABuild+info%3A+version%3A+%272%2E30%2E0%27%2C+revision%3A+%27dc1ef9c%27%2C+time%3A+%272013%2D02%2D19+00%3A15%3A27%27%0ASystem+info%3A+os%2Ename%3A+%27Linux%27%2C+os%2Earch%3A+%27amd64%27%2C+os%2Eversion%3A+%273%2E2%2E0%2D37%2Dgeneric%27%2C+java%2Eversion%3A+%271%2E6%2E0%5F27%27%0ADriver+info%3A+driver%2Eversion%3A+unknown\r\nDate: Tue, 26 Feb 2013 17:49:05 GMT\r\nServer: Jetty/5.1.x (Linux/3.2.0-37-generic amd64 java/1.6.0_27\r\nConnection: close\r\nExpires: Thu, 01 Jan 1970 00:00:00 GMT\r\nCache-Control: no-cache\r\nContent-Type: text/html\r\nContent-Length: 1946\r\n\r\n\n\n<title>Error 500 org.openqa.selenium.WebDriverException: java.lang.ClassCastException: java.lang.Long cannot be cast to java.lang.String\nBuild info: version: '2.30.0', revision: 'dc1ef9c', time: '2013-02-19 00:15:27'\nSystem info: os.name: 'Linux', os.arch: 'amd64', os.version: '3.2.0-37-generi...

The solution is to make sure it's a string: send_keys($var ."")

Restore a standard ChangeLog format

The latest Change log entries are just dumps of raw commits message. This goes against the conventions of CPAN modules, and adds little value of just reading the raw commit history on Github, which is already easily available.

We should instead to return to summarizing the commits in a more user-oriented form. There's a spec on CPAN for recommended Changelog format which provides some guidance: https://metacpan.org/module/CPAN::Changes::Spec

The groupings that WWW::Mechanize uses are particularly nice, although some of the formatting varies from what's recommended in the spec above:

https://metacpan.org/changes/distribution/WWW-Mechanize

How to setup PerlBindings for selenium

Hi,

I am a newbie to this selenium automation. Currently I'm using selenium IDE 1.4.1 and stand-alone server 2.14.0 to automate the scripts. But I 'm unable to automate the scripts in google-chrome though my script runs fine in firefox.

Could you help how to setup this Selenium RC and WebDriver to automate the browser. Also I have visited the http://seleniumhq.org/docs/03_webdriver.html site on how to do it. But 'm unable to understand because it refers to a link for perlbindings which shows https://metacpan.org/module/Selenium::Remote::Driver module.

I have installed this module also.

Could you help me on how to proceed further from here on to setup it and start running the scripts. I would like to give me a example program on how to do it.

Thanks,
Anurag

Support for passing applicationName capability to constructor

I have modified Driver.pm to support applicationName capability on my local copy. I would like to know if this support is planned or if there is any need.

The two lines I added to support this where:

to the new method:
application_name => delete $args{application_name} || undef,

to the new_session method:
'applicationName' => $self->{application_name},

Would be nice to support this capability since it can be used in many creative ways. One of them being to select SPECIFIC browser/os/platform combinations when running tests.

Grid connection problem

When connecting to Grid servers, the URL called to verify is
grid/api/testsession

This URL , for some reason, does not always work properly (error 500).
Would it be possible to check URL grid/api/hub/status instead ?

Regards

Minimum version of Perl supported?

At this point, this module does not list the minimum version of Perl that is supported. We should make it explicit in our code & Makefile.

Documentation Fix for find_child_element(s)

In the documentation for Selenium::Remote::Driver::find_child_element(), it uses an xpath selector like:

my $child = $driver->find_child_element($elem1, "//option[\@value='es_ar']");

However, I've found that this does not exclusively search under the child node, and will return every option tag on the page with value="es_ar".

This version:

my @children = $driver->find_child_elements($elem1, "//option[1]");

Would return the first option tag of every select tag on the page.

I would suggest that xpath selectors be changed to search only under the given parent, but I'm not sure the way it works now is actually wrong. Using '//' at the beginning means you probably do want to search the whole page. Instead, I suggest the documentation for these two functions be fixed to use './', like:

my @children = $driver->find_child_elements($elem1, "./option[\@value='es_ar]");

This correctly searches only children of the parent element.

Can't use an undefined value as an ARRAY reference at /usr/lib/perl5/site_perl/5.10.0/Selenium/Remote/Driver.pm line 1303, <$fh> line 1.

find_child_elements seems to croak with the following Perl error when it can't find child elements. That error does not seem very precise.

Can't use an undefined value as an ARRAY reference at /usr/lib/perl5/site_perl/5.10.0/Selenium/Remote/Driver.pm line 1303, <$fh> line 1.

sub cells {
my ( $driver, $text, @cells ) = @_;
my $label;
eval {
$label = $driver->find_element("//*[normalize-space(text())='$text']");
};
if ($@) {
warn "Failed to find text '$text': $@";
}
else {
my $first = '';
ROW:

    for ( my $row = 1 ; ; $row++ ) {
        my @cell;
        eval {
            @cell = $driver->find_child_elements( $label,

"../../../following-sibling::*/div/div/div/div/div/div[2]/div/div/div/div/div[$row]/div"
);
};
if ($@) {
if ( $row == 1 ) {
warn "Failed to find row #$row: $@";
last;
}

The version is 0.12.

Absorb "glue" methods from Test::WebDriver ?

Test::WebDriver includes some methods which might be better housed here. Other committers, what do you think about merging these shortcut methods into this class? I'm in favor.

get_text()  -> shortcut for:  $self->find_element(@_)->get_text();
get_body() -> shortcut for: $self->get_text('//body');
get_path() -> get's the relative uri of the request. 
                   (Perhaps better name "get_relative_url()" to avoid confusion with 
                    "path info")

It also includes get_location() as an alias for get_current_url(). I feel less strongly about that. This is just an alternate name, and get current_url() is arguably clearer.

Sending non-text keys with send_keys

Hi,

I'm trying to figure out how to send non-text keys (tab, enter, etc) to an element using send_keys. The JSON Wire Protocol wiki document in has a list of codes for different keys, but of course if I pass U+E032 as a string to send_keys, it just types the literal string into the input field. I can't figure out how to pass it particular keystrokes using these perl bindings.

Does anyone know how I would accomplish this, or where I can find more information ? I'd like to be able to send the Enter key primarily, but the tab key would also be nice. Some places say that "\t" would translate to a tab but I haven't had success with that. Apparently if I were using Java I'd just import something about Keys and then I'd be able to pass them that way.

Let me know if there's any additional information I can provide that would be helpful.

Thanks,

Daniel Gempesaw

Adding a cookie

I am unable to add a cookie. Even when I use a simple example ..
$driver->add_cookie('foo','bar','/','server i am pointing at',0);

I also tried spoofing a real looking domain name and pointing it to the server I want to test against and then using that domain name here. It doesn't work. Crashes the same way for a firefox and chrome web driver.

I get error :

(Error while executing command: An unknown server-side error occurred while processing the command.: given 'cookie' parameters are invalid (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 20 milliseconds
Build info: version: '2.24.1', revision: '17205', time: '2012-06-19 17:28:14'
System info: os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.7.0_13'
Driver info: driver.version: RemoteWebDriver
Session ID: cdbf4aca4034937573ca0cea4a9e5977 at C:/workspace/ST/t/TestCl.pm line 21.)

This is the code I am using to create my driver :

return new Selenium::Remote::Driver(
'browser_name' => 'chrome',
'port' => '4444',
'proxy' => { 'proxyType' => 'direct' }
);

Unable to run simple example

I'm looking into moving from selenium RC to webdriver using perl. So this is my first attempt at running Selenium::Remote::Driver

As my server I'm using selenium-server-standalone-2.16.0.jar

Selenium::Remover::Driver is the latest version from CPAN.

My browser is Firefox 8.0

I am trying to run the simple example in the documentation:

use Selenium::Remote::Driver;
my $driver = new Selenium::Remote::Driver;
$driver->get('http://www.google.com');
print $driver->get_title();
$driver->quit();

The browser window appears, however it hangs while trying to connect to google and I get the log:

11:23:42.028 INFO - Executing: org.openqa.selenium.remote.server.handler.Status@643ae941 at URL: /status)
11:23:42.064 INFO - Done: /status
11:23:42.129 INFO - Executing: [new session: {platform=ANY, javascriptEnabled=true, browserName=firefox, version=}] at URL: /session)
11:23:50.263 INFO - Done: /session
11:23:50.272 INFO - Executing: org.openqa.selenium.remote.server.handler.GetSessionCapabilities@31554233 at URL: /session/1325762586925)
11:23:50.273 INFO - Done: /session/1325762586925
11:23:50.284 INFO - Executing: [get: http://www.google.com] at URL: /session/1325762586925/url)
malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "read timeout at /usr...") at /usr/local/share/perl/5.12.4/Selenium/Remote/RemoteConnection.pm line 77.
11:26:50.389 INFO - Executing: [delete session: 1325762586925] at URL: /session/1325762586925)
(in cleanup) malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "read timeout at /usr...") at /usr/local/share/perl/5.12.4/Selenium/Remote/RemoteConnection.pm line 77.

I can do the equivalent successfully using a Test::WWW::Selenium script, so I know that the selenium server and access to google is OK.

Any ideas as to what the problem might be?

profile issue.

Hi I'm trying to use Selenium::Remote::Driver with a custom firefox profile.

But I can't do it.

After create a new profile and install the firefox extension that I need.
I putted the next parameter to run the server.jar.

java -jar selenium-server-standalone-2.33.0.jar -firefoxProfileTemplate "C:/Users/xxxxx/AppData/Roaming/Mozilla/Firefox/Profiles/qb15bznl.selenium/"

When I run the test. The firefox open ok. But It is using an Anonymous profile without extensions. I don't Know whats happening. I'm sura that are the correct parameters.

Can you help me please?
Does exist another way to open the firefox with a custom profile?

thanks a lot.

Add pause() method for compatibility with Test::WWW::Selenium

Test::WWW::Selenium has a pause() method. Although the "wait_for..." method is often a better choice, a pause method could come in handy sometimes, and could ease porting code over. Here's what their implementation looks like, which could be directly copied:

sub pause {
my ($self,$timeout) = @_;
$timeout = 1000  unless defined $timeout;
$timeout /= 1000;
sleep $timeout;
}

Can we use Selenium RC & Web driver in same browser session simultaneously?

Thanks to you & your team for bringing up the perl bindings for Selenium webdriver.

Below are my requirements:

  1. Start Webdriver backed selenium RC server with IE as browser
  2. Execute steps of tests using RC server
  3. Switch to Webdriver mode in the same browser session & continue couple of tests
  4. Switch back to RC mode.

Is this achievable? Please provide a sample script if possible...

Many thanks,
Arun
[email protected]

cannot set auto_close to false when creating a new selenium driver

I am trying to disable auto close for a Selenium::Remote::Driver that I want to create. However, auto_close always remains 1.

Here is my piece of code and the debug output by Data::Dumper. You can see in the Data::Dumper output that auto_close is still set to 1 . Behaviorally too , the driver closes the session.

use Selenium::Remote::Driver;

my $sel = Selenium::Remote::Driver->new(
        browser_name => 'firefox',
        auto_close => 0,
        remote_server_addr =>   'localhost',
        proxy_type          =>  'direct'
);

use Data::Dumper;

print Dumper($sel);

Program output

C:\workspace\test>perl repro-sel-issue.pl
$VAR1 = bless( {
                 'remote_conn' => bless( {
                                           'remote_server_addr' => 'localhost',
                                           'debug' => 0,
                                           'port' => '4444'
                                         }, 'Selenium::Remote::RemoteConnection' ),
                 'browser_name' => 'firefox',
                 'session_id' => '9fe78193-0910-4690-a0de-fde7b59fb4f8',
                 'version' => '',
                 'commands' => bless( {
                                        'setWindowSize' => {
                                                             'url' => 'session/:sessionId/window/:windowHandle/size',
                                                             'method' => 'POST'
                                                           },
                                        'deleteCookieNamed' => {
                                                                 'url' => 'session/:sessionId/cookie/:name',
                                                                 'method' => 'DELETE'
                                                               },
                                        'getElementText' => {
                                                              'url' => 'session/:sessionId/element/:id/text',
                                                              'method' => 'GET'
                                                            },
                                        'getElementTagName' => {
                                                                 'url' => 'session/:sessionId/element/:id/name',
                                                                 'method' => 'GET'
                                                               },
                                        'refresh' => {
                                                       'url' => 'session/:sessionId/refresh',
                                                       'method' => 'POST'
                                                     },
                                        'goForward' => {
                                                         'url' => 'session/:sessionId/forward',
                                                         'method' => 'POST'
                                                       },
                                        'newSession' => {
                                                          'url' => 'session',
                                                          'method' => 'POST'
                                                        },
                                        'setTimeout' => {
                                                          'url' => 'session/:sessionId/timeouts',
                                                          'method' => 'POST'
                                                        },
                                        'sendKeysToElement' => {
                                                                 'url' => 'session/:sessionId/element/:id/value',
                                                                 'method' => 'POST'
                                                               },
                                        'buttonDown' => {
                                                          'url' => 'session/:sessionId/buttondown',
                                                          'method' => 'POST'
                                                        },
                                        'isElementDisplayed' => {
                                                                  'url' => 'session/:sessionId/element/:id/displayed',
                                                                  'method' => 'GET'
                                                                },
                                        'elementEquals' => {
                                                             'url' => 'session/:sessionId/element/:id/equals/:other',
                                                             'method' => 'GET'
                                                           },
                                        'sendKeysToPrompt' => {
                                                                'url' => 'session/:sessionId/alert_text',
                                                                'method' => 'POST'
                                                              },
                                        'isElementSelected' => {
                                                                 'url' => 'session/:sessionId/element/:id/selected',
                                                                 'method' => 'GET'
                                                               },
                                        'getCurrentUrl' => {
                                                             'url' => 'session/:sessionId/url',
                                                             'method' => 'GET'
                                                           },
                                        'setImplicitWaitTimeout' => {
                                                                      'url' => 'session/:sessionId/timeouts/implicit_wait',
                                                                      'method' => 'POST'
                                                                    },
                                        'sendKeysToActiveElement' => {
                                                                       'url' => 'session/:sessionId/keys',
                                                                       'method' => 'POST'
                                                                     },
                                        'availableEngines' => {
                                                                'url' => 'session/:sessionId/ime/available_engines',
                                                                'method' => 'GET'
                                                              },
                                        'clearElement' => {
                                                            'url' => 'session/:sessionId/element/:id/clear',
                                                            'method' => 'POST'
                                                          },
                                        'getElementLocation' => {
                                                                  'url' => 'session/:sessionId/element/:id/location',
                                                                  'method' => 'GET'
                                                                },
                                        'getCurrentWindowHandle' => {
                                                                      'url' => 'session/:sessionId/window_handle',
                                                                      'method' => 'GET'
                                                                    },
                                        'click' => {
                                                     'url' => 'session/:sessionId/click',
                                                     'method' => 'POST'
                                                   },
                                        'submitElement' => {
                                                             'url' => 'session/:sessionId/element/:id/submit',
                                                             'method' => 'POST'
                                                           },
                                        'describeElement' => {
                                                               'url' => 'session/:sessionId/element/:id',
                                                               'method' => 'GET'
                                                             },
                                        'switchToWindow' => {
                                                              'url' => 'session/:sessionId/window',
                                                              'method' => 'POST'
                                                            },
                                        'deleteAllCookies' => {
                                                                'url' => 'session/:sessionId/cookie',
                                                                'method' => 'DELETE'
                                                              },
                                        'getElementValueOfCssProperty' => {
                                                                            'url' => 'session/:sessionId/element/:id/css/:propertyName',
                                                                            'method' => 'GET'
                                                                          },
                                        'getAllCookies' => {
                                                             'url' => 'session/:sessionId/cookie',
                                                             'method' => 'GET'
                                                           },
                                        'screenshot' => {
                                                          'url' => 'session/:sessionId/screenshot',
                                                          'method' => 'GET'
                                                        },
                                        'uploadFile' => {
                                                          'url' => 'session/:sessionId/file',
                                                          'method' => 'POST'
                                                        },
                                        'hoverOverElement' => {
                                                                'url' => 'session/:sessionId/element/:id/hover',
                                                                'method' => 'POST'
                                                              },
                                        'setAsyncScriptTimeout' => {
                                                                     'url' => 'session/:sessionId/timeouts/async_script',
                                                                     'method' => 'POST'
                                                                   },
                                        'toggleElement' => {
                                                             'url' => 'session/:sessionId/element/:id/toggle',
                                                             'method' => 'POST'
                                                           },
                                        'findChildElements' => {
                                                                 'url' => 'session/:sessionId/element/:id/elements',
                                                                 'method' => 'POST'
                                                               },
                                        'getActiveElement' => {
                                                                'url' => 'session/:sessionId/element/active',
                                                                'method' => 'POST'
                                                              },
                                        'findElements' => {
                                                            'url' => 'session/:sessionId/elements',
                                                            'method' => 'POST'
                                                          },
                                        'executeAsyncScript' => {
                                                                  'url' => 'session/:sessionId/execute_async',
                                                                  'method' => 'POST'
                                                                },
                                        'getElementLocationInView' => {
                                                                        'url' => 'session/:sessionId/element/:id/location_in_view',
                                                                        'method' => 'GET'
                                                                      },
                                        'addCookie' => {
                                                         'url' => 'session/:sessionId/cookie',
                                                         'method' => 'POST'
                                                       },
                                        'getElementAttribute' => {
                                                                   'url' => 'session/:sessionId/element/:id/attribute/:name',
                                                                   'method' => 'GET'
                                                                 },
                                        'mouseMoveToLocation' => {
                                                                   'url' => 'session/:sessionId/moveto',
                                                                   'method' => 'POST'
                                                                 },
                                        'doubleClick' => {
                                                           'url' => 'session/:sessionId/doubleclick',
                                                           'method' => 'POST'
                                                         },
                                        'getElementSize' => {
                                                              'url' => 'session/:sessionId/element/:id/size',
                                                              'method' => 'GET'
                                                            },
                                        'goBack' => {
                                                      'url' => 'session/:sessionId/back',
                                                      'method' => 'POST'
                                                    },
                                        'setElementSelected' => {
                                                                  'url' => 'session/:sessionId/element/:id/selected',
                                                                  'method' => 'POST'
                                                                },
                                        'getWindowSize' => {
                                                             'url' => 'session/:sessionId/window/:windowHandle/size',
                                                             'method' => 'GET'
                                                           },
                                        'getTitle' => {
                                                        'url' => 'session/:sessionId/title',
                                                        'method' => 'GET'
                                                      },
                                        'status' => {
                                                      'url' => 'status',
                                                      'method' => 'GET'
                                                    },
                                        'clickElement' => {
                                                            'url' => 'session/:sessionId/element/:id/click',
                                                            'method' => 'POST'
                                                          },
                                        'getWindowHandles' => {
                                                                'url' => 'session/:sessionId/window_handles',
                                                                'method' => 'GET'
                                                              },
                                        'sendModifier' => {
                                                            'url' => 'session/:sessionId/modifier',
                                                            'method' => 'POST'
                                                          },
                                        'getPageSource' => {
                                                             'url' => 'session/:sessionId/source',
                                                             'method' => 'GET'
                                                           },
                                        'close' => {
                                                     'url' => 'session/:sessionId/window',
                                                     'method' => 'DELETE'
                                                   },
                                        'getSessions' => {
                                                           'url' => 'sessions',
                                                           'method' => 'GET'
                                                         },
                                        'get' => {
                                                   'url' => 'session/:sessionId/url',
                                                   'method' => 'POST'
                                                 },
                                        'dragElement' => {
                                                           'url' => 'session/:sessionId/element/:id/drag',
                                                           'method' => 'POST'
                                                         },
                                        'setWindowPosition' => {
                                                                 'url' => 'session/:sessionId/window/:windowHandle/position',
                                                                 'method' => 'POST'
                                                               },
                                        'quit' => {
                                                    'url' => 'session/:sessionId',
                                                    'method' => 'DELETE'
                                                  },
                                        'acceptAlert' => {
                                                           'url' => 'session/:sessionId/accept_alert',
                                                           'method' => 'POST'
                                                         },
                                        'findElement' => {
                                                           'url' => 'session/:sessionId/element',
                                                           'method' => 'POST'
                                                         },
                                        'switchToFrame' => {
                                                             'url' => 'session/:sessionId/frame',
                                                             'method' => 'POST'
                                                           },
                                        'buttonUp' => {
                                                        'url' => 'session/:sessionId/buttonup',
                                                        'method' => 'POST'
                                                      },
                                        'isElementEnabled' => {
                                                                'url' => 'session/:sessionId/element/:id/enabled',
                                                                'method' => 'GET'
                                                              },
                                        'executeScript' => {
                                                             'url' => 'session/:sessionId/execute',
                                                             'method' => 'POST'
                                                           },
                                        'findChildElement' => {
                                                                'url' => 'session/:sessionId/element/:id/element',
                                                                'method' => 'POST'
                                                              },
                                        'getAlertText' => {
                                                            'url' => 'session/:sessionId/alert_text',
                                                            'method' => 'GET'
                                                          },
                                        'dismissAlert' => {
                                                            'url' => 'session/:sessionId/dismiss_alert',
                                                            'method' => 'POST'
                                                          },
                                        'getWindowPosition' => {
                                                                 'url' => 'session/:sessionId/window/:windowHandle/position',
                                                                 'method' => 'GET'
                                                               },
                                        'getCapabilities' => {
                                                               'url' => 'session/:sessionId',
                                                               'method' => 'GET'
                                                             }
                                      }, 'Selenium::Remote::Commands' ),
                 'javascript' => bless( do{\(my $o = 1)}, 'JSON::XS::Boolean' ),
                 'port' => '4444',
                 'remote_server_addr' => 'localhost',
                 'auto_close' => 1,
                 'pid' => '8916',
                 'platform' => 'ANY',
                 'accept_ssl_certs' => $VAR1->{'javascript'}
               }, 'Selenium::Remote::Driver' );

C:\workspace\test>

driver-example.pl bug and test scripts

First off - thank you very much for creating this. I'm also able to offer a bounty to bring this up to date or fix the Mac/Unix issues. Thanks!

Environment:

Using Selenium 2.0rc3 on Mac OSX 10.6. Using perl 5, version 12, subversion 3 (v5.12.3) built for darwin-thread-multi-2level (with 9 registered patches, see perl -V for more detail). Binary build 1204 [294330] provided by ActiveState http://www.ActiveState.com built Feb 9 2011 14:47:05

Problems

  1. $driver->get_title() is not dereferenced correctly -- getting this 'HASH(0x9b4970)' instead of 'Google'
  2. make test has failures

make test results below:

[~/projects/webtesting/Selenium-Remote-Driver] $ make test
Skip blib/lib/Selenium/Remote/Driver.pm (unchanged)
Skip blib/lib/Selenium/Remote/RemoteConnection.pm (unchanged)
Skip blib/lib/Selenium/Remote/Commands.pm (unchanged)
Skip blib/lib/Selenium/Remote/ErrorHandler.pm (unchanged)
cp driver-example.pl blib/lib/Selenium/Remote/driver-example.pl
Skip blib/lib/Selenium/Remote/WebElement.pm (unchanged)
PERL_DL_NONLAZY=1 /usr/local/ActivePerl-5.12/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'inc', 'blib/lib', 'blib/arch')" t/00-load.t t/01-driver-live.t t/02-webelement-live.t
t/00-load.t ............. ok
t/01-driver-live.t ...... 1/? Server failed.
t/01-driver-live.t ...... 6/? malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "(end of string)") at /Users/hayesw/projects/webtesting/Selenium-Remote-Driver/blib/lib/Selenium/Remote/RemoteConnection.pm line 80

Looks like your test exited with 255 just after 11.

t/01-driver-live.t ...... Dubious, test returned 255 (wstat 65280, 0xff00)
All 11 subtests passed
t/02-webelement-live.t .. 1/? Server failed.
t/02-webelement-live.t .. 2/? malformed JSON string, neither array, object, number, string or atom, at character offset 0 (before "(end of string)") at /Users/hayesw/projects/webtesting/Selenium-Remote-Driver/blib/lib/Selenium/Remote/RemoteConnection.pm line 80

Looks like your test exited with 255 just after 14.

    (in cleanup) Can't call method "get_params" on an undefined value at /Users/hayesw/projects/webtesting/Selenium-Remote-Driver/blib/lib/Selenium/Remote/Driver.pm line 231 during global destruction.

t/02-webelement-live.t .. Dubious, test returned 255 (wstat 65280, 0xff00)
All 14 subtests passed

Test Summary Report

t/01-driver-live.t (Wstat: 65280 Tests: 11 Failed: 0)
Non-zero exit status: 255
t/02-webelement-live.t (Wstat: 65280 Tests: 14 Failed: 0)
Non-zero exit status: 255
Files=3, Tests=26, 6 wallclock secs ( 0.03 usr 0.01 sys + 0.47 cusr 0.04 csys = 0.55 CPU)
Result: FAIL
Failed 2/3 test programs. 0/26 subtests failed.
make: *** [test_dynamic] Error 255

Selenium2 Server results from 'make test'

21:17:07.759 INFO - Executing: [new session: {platform=ANY, javascriptEnabled=true, browserName=firefox, version=}] at URL: /session)
21:17:09.830 INFO - Done: /session
21:17:09.834 INFO - Executing: org.openqa.selenium.remote.server.handler.GetSessionCapabilities@3622e177 at URL: /session/1308874266570)
21:17:09.834 INFO - Done: /session/1308874266570
21:17:09.838 INFO - Executing: org.openqa.selenium.remote.server.handler.GetSessionCapabilities@4d811e2c at URL: /session/1308874266570)
21:17:09.838 INFO - Done: /session/1308874266570
21:17:09.842 INFO - Executing: [get: http://localhost:63636/index.html] at URL: /session/1308874266570/url)
21:17:10.001 INFO - Done: /session/1308874266570/url
21:17:10.004 INFO - Executing: [get title] at URL: /session/1308874266570/title)
21:17:10.025 INFO - Done: /session/1308874266570/title
21:17:10.028 INFO - Executing: [get current url] at URL: /session/1308874266570/url)
21:17:10.034 INFO - Done: /session/1308874266570/url
21:17:10.037 INFO - Executing: [get current window handle] at URL: /session/1308874266570/window_handle)
21:17:10.041 INFO - Done: /session/1308874266570/window_handle
21:17:10.045 INFO - Executing: [get window handles] at URL: /session/1308874266570/window_handles)
21:17:10.095 INFO - Done: /session/1308874266570/window_handles
21:17:10.099 INFO - Executing: [get page source] at URL: /session/1308874266570/source)
21:17:10.105 INFO - Done: /session/1308874266570/source
21:17:10.154 INFO - Executing: [delete session: 1308874266570] at URL: /session/1308874266570)
21:17:10.948 INFO - Done: /session/1308874266570
21:17:11.133 INFO - Executing: [new session: {platform=ANY, javascriptEnabled=true, browserName=firefox, version=}] at URL: /session)
21:17:12.587 INFO - Done: /session
21:17:12.590 INFO - Executing: org.openqa.selenium.remote.server.handler.GetSessionCapabilities@7c9b87f6 at URL: /session/1308874266571)
21:17:12.591 INFO - Done: /session/1308874266571
21:17:12.594 INFO - Executing: [get: http://localhost:63636/formPage.html] at URL: /session/1308874266571/url)
21:17:12.841 INFO - Done: /session/1308874266571/url
21:17:12.856 INFO - Executing: [find element: By.xpath: //a[@href='/index.html']] at URL: /session/1308874266571/element)
21:17:12.927 INFO - Done: /session/1308874266571/element
21:17:12.931 INFO - Executing: [click: 0 org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement@e33fd5fb] at URL: /session/1308874266571/element/0/click)
21:17:13.031 INFO - Done: /session/1308874266571/element/0/click
21:17:13.035 INFO - Executing: [get title] at URL: /session/1308874266571/title)
21:17:13.046 INFO - Done: /session/1308874266571/title
21:17:13.051 INFO - Executing: [go back] at URL: /session/1308874266571/back)
21:17:13.091 INFO - Done: /session/1308874266571/back
21:17:13.093 INFO - Executing: [find element: By.id: withText] at URL: /session/1308874266571/element)
21:17:13.098 INFO - Done: /session/1308874266571/element
21:17:13.101 INFO - Executing: [get text: 1 org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement@6dcdb383] at URL: /session/1308874266571/element/1/text)
21:17:13.130 INFO - Done: /session/1308874266571/element/1/text
21:17:13.133 INFO - Executing: [find element: By.id: id-name1] at URL: /session/1308874266571/element)
21:17:13.144 INFO - Done: /session/1308874266571/element
21:17:13.147 INFO - Executing: [get value: 2 org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement@e99268f8] at URL: /session/1308874266571/element/2/value)
21:17:13.154 INFO - Done: /session/1308874266571/element/2/value
21:17:13.158 INFO - Executing: [get element attribute: 2 org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement@e99268f8, value] at URL: /session/1308874266571/element/2/attribute/value)
21:17:13.164 INFO - Done: /session/1308874266571/element/2/attribute/value
21:17:13.167 INFO - Executing: [tag name: 2 org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement@e99268f8] at URL: /session/1308874266571/element/2/name)
21:17:13.174 INFO - Done: /session/1308874266571/element/2/name
21:17:13.177 INFO - Executing: [find element: By.id: checky] at URL: /session/1308874266571/element)
21:17:13.183 INFO - Done: /session/1308874266571/element
21:17:13.187 INFO - Executing: [is selected: 3 org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement@82271f83] at URL: /session/1308874266571/element/3/selected)
21:17:13.192 INFO - Done: /session/1308874266571/element/3/selected
21:17:13.195 INFO - Executing: [click: 3 org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement@82271f83] at URL: /session/1308874266571/element/3/click)
21:17:13.254 INFO - Done: /session/1308874266571/element/3/click
21:17:13.257 INFO - Executing: [is selected: 3 org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement@82271f83] at URL: /session/1308874266571/element/3/selected)
21:17:13.260 INFO - Done: /session/1308874266571/element/3/selected
21:17:13.264 INFO - Executing: [toggle: 3 org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement@82271f83] at URL: /session/1308874266571/element/3/toggle)
21:17:13.269 INFO - Done: /session/1308874266571/element/3/toggle
21:17:13.273 INFO - Executing: [is selected: 3 org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement@82271f83] at URL: /session/1308874266571/element/3/selected)
21:17:13.277 INFO - Done: /session/1308874266571/element/3/selected
21:17:13.280 INFO - Executing: [get: http://localhost:63636/dragAndDropTest.html] at URL: /session/1308874266571/url)
21:17:13.311 INFO - Done: /session/1308874266571/url
21:17:13.314 INFO - Executing: [find element: By.id: test1] at URL: /session/1308874266571/element)
21:17:13.327 INFO - Done: /session/1308874266571/element
21:17:13.330 INFO - Executing: [get element size: 4 org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement@3f50f22c] at URL: /session/1308874266571/element/4/size)
21:17:13.335 INFO - Done: /session/1308874266571/element/4/size
21:17:13.339 INFO - Executing: [get location: 4 org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement@3f50f22c] at URL: /session/1308874266571/element/4/location)
21:17:13.344 INFO - Done: /session/1308874266571/element/4/location

Individual browser drivers?

Is there any demand for supporting individual browser drivers? Currently this module does cover all browsers through the remote server, but if someone wants to use it just for IE (or any one browser for that matter) this is kind of heavy weight.

We can easily subclass the remote driver to create individual browser drivers. So we could end up with Selenium::Remote::Driver, Selenium::IE::Driver, Selenium::Opera::Driver & so on. We will have to change a few things, for e.g. currently /wd/hub url is hardcoded but the individual browser bindings don't use that url prefix. Also we might have to rename the project name name to something more appropriate but regardless, none of these are drastic changes.

LWP::Protocol::http::Socket: connect: An operation was attempted on a non-blocking socket

I can get my code to do this after running for a few hours; it appears to happen between random intervals:

[0,2] [Baseball] Proccessed: LA Angels v Toronto,0 - 0,1.53,2.50
Error while executing command: Server returned error message Can't connect to localhost:4444 (An operation was attempted
on a non-blocking socket that already had an operation in progress.)

LWP::Protocol::http::Socket: connect: An operation was attempted on a non-blocking socket that already had an operation
in progress. at C:/perl/perl/vendor/lib/LWP/Protocol/http.pm line 51.
instead of data at run.pl line 36.

WebDriverBackedSelenium support?

This isn't a bug nor enhancement request but posting as a discussion topic.

See the following for background:

https://groups.google.com/forum/?fromgroups#!topic/selenium-users/6E53jIIT0TE

http://seleniumhq.wordpress.com/2012/02/08/announcing-selenium-2-19-the-prancing-unicorn-release/

Selenium server now includes the WebDriverBackedSelenium functionality of WebDriver as part of server that any language binding can use. But to use it requires use of some WebDriver code (say via this project's Selenium 2 bindings) to start up WebDriver browser session then pass that session to Selenium RC code/bindings to work with via the old RC API but using WebDriver "underneath".

I think it would be helpful to the community to have Perl support for this new server side functionality. For those not yet ready to migrate to WebDriver API.

I assume this hasn't been implemented yet. If already done, ignore.

But for this support, I'm guessing requires updating the Perl RC bindings available on CPAN. How might we get this done? Since Perl is no longer an officially supported binding...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.