{"id":16537073,"url":"https://github.com/teodesian/selenium-pageobjects-perl","last_synced_at":"2025-06-16T11:05:25.019Z","repository":{"id":83069556,"uuid":"22393524","full_name":"teodesian/Selenium-PageObjects-Perl","owner":"teodesian","description":"Perl module/class to help create Page Objects.  Analogous to Selenium's PageFactory Class.","archived":false,"fork":false,"pushed_at":"2015-02-11T20:16:47.000Z","size":533,"stargazers_count":3,"open_issues_count":3,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-04T20:46:25.041Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Perl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/teodesian.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-07-29T20:00:25.000Z","updated_at":"2017-12-12T13:21:42.000Z","dependencies_parsed_at":"2023-02-25T11:35:28.671Z","dependency_job_id":null,"html_url":"https://github.com/teodesian/Selenium-PageObjects-Perl","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/teodesian/Selenium-PageObjects-Perl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teodesian%2FSelenium-PageObjects-Perl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teodesian%2FSelenium-PageObjects-Perl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teodesian%2FSelenium-PageObjects-Perl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teodesian%2FSelenium-PageObjects-Perl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/teodesian","download_url":"https://codeload.github.com/teodesian/Selenium-PageObjects-Perl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/teodesian%2FSelenium-PageObjects-Perl/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260148280,"owners_count":22965910,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T18:34:43.537Z","updated_at":"2025-06-16T11:05:24.972Z","avatar_url":"https://github.com/teodesian.png","language":"Perl","funding_links":[],"categories":[],"sub_categories":[],"readme":"Selenium-PageObjects-Perl\n=========================\n\n\u003cimg src=\"https://travis-ci.org/teodesian/Selenium-PageObjects-Perl.svg\" alt=\"Travis CI build status\" /\u003e\n\u003ca href='https://coveralls.io/r/teodesian/Selenium-PageObjects-Perl'\u003e\u003cimg src='https://coveralls.io/repos/teodesian/Selenium-PageObjects-Perl/badge.svg' alt='Coverage Status' /\u003e\u003c/a\u003e\n\nPerl module/class to help create Page Objects.  Analogous to Selenium's PageFactory Class.\nCan use both WWW::Selenium and Selenium::Remote::Driver objects as drivers.\n\nSee:\nhttps://code.google.com/p/selenium/wiki/PageFactory for info about PageFactory\nand\nhttps://code.google.com/p/selenium/wiki/PageObjects\nfor more info about page objects themselves.\n\nExample Usage:\n\n\u003e package SomePage;\n\u003e\n\u003e use Selenium::PageObject;\n\u003e\n\u003e our @ISA = qw(SeleniumPageObject);\n\u003e\n\u003e\n\u003e sub new {\n\u003e\n\u003e    my ($class,$driver);\n\u003e\n\u003e    return $class-\u003eSUPER::new($class,$driver,\"/somepage.html\");\n\u003e\n\u003e }\n\u003e\n\u003e\n\u003e sub doStuff {\n\u003e\n\u003e   my ($self,$stuff2type,$option2select);\n\u003e\n\u003e   my $textBox = $self-\u003eSUPER::getElement('someBox','id');\n\u003e\n\u003e   my $customResult = $textBox-\u003eset($stuff2type,sub {\n\u003e\n\u003e       my $self = shift; #full access to parent page object\n\u003e\n\u003e       $self-\u003edismissAlert(); #Callback to dismiss stupid alert that pops up when we type stuff into this box...\n\u003e\n\u003e       return $self-\u003edriver-\u003edoSomethingSpecificToMyDriverModule('foo'); #While the underlying driver is always available, you should avoid doing this in pageObjects you expect to work with any driver module.\n\u003e\n\u003e   });\n\u003e\n\u003e\n\u003e   my $successes = 0;\n\u003e\n\u003e   my $count = scalar(@listboxes);\n\u003e\n\u003e   my @listBoxes = $self-\u003eSUPER::getElement('.listbox','class');\n\u003e\n\u003e   foreach my $box (@listboxes) {\n\u003e\n\u003e        #Set all boxes to have the relevant element selected.\n\u003e\n\u003e        unless ($box-\u003eisSelect) {\n\u003e\n\u003e            $count--;\n\u003e\n\u003e            next;\n\u003e\n\u003e        }\n\u003e\n\u003e        warn \"box has no glarch option\" unless $box-\u003ehasOptions($options2select));\n\u003e\n\u003e        $successes += $box-\u003eset($option2select); #returns 1 or 0 depending on whether it could set it or not\n\u003e\n\u003e    }\n\u003e\n\u003e    return !($count - $success); # if successes = num of listboxes, yay\n\u003e\n\u003e }\n\u003e\n\u003e\n\u003e sub Submit {\n\u003e\n\u003e   my $self = shift;\n\u003e\n\u003e   return $self-\u003eSUPER::submit('someButton','id',sub {...}); #Callback to handle whatever we think a successful submission does\n\u003e\n\u003e }\n\nHow the test author should end up using this:\n\n\u003e use Selenium::Remote::Driver;\n\u003e\n\u003e use SomePage; #The module we made above\n\u003e\n\u003e my $webDriver = Selenium::Remote::Driver-\u003enew({'remote_server_addr' =\u003e 'localhost');\n\u003e\n\u003e $webDriver-\u003eget('http://my-app.test/');\n\u003e\n\u003e my $somePage = SomePage-\u003enew($webDriver);\n\u003e\n\u003e $somePage-\u003edoStuff('blah','someOption');\n\u003e\n\u003e ok($somePage-\u003eSubmit(),\"Page did needful\");\n\nRefer to the POD for futher information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteodesian%2Fselenium-pageobjects-perl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fteodesian%2Fselenium-pageobjects-perl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fteodesian%2Fselenium-pageobjects-perl/lists"}