nearsoft / php-selenium-client Goto Github PK
View Code? Open in Web Editor NEWPHP interaction with Selenium Webdriver API
PHP interaction with Selenium Webdriver API
I can't find anything on the documentation. is there any way to do it with the actual version of SeleniumClient?
if not, is it in the roadmap to implement some sort of BrowserProfile object that you can inject into DesirableCapabilities/WebDriver class?
thanks.
I didn't find a way to send this command using the PHP client.
I've been searching through the examples and the documentation to find a way on using multiple browsers. I was not able to find it.
With PHPUnit Selenium I am able to do this: http://phpunit.de/manual/3.7/en/selenium.html#selenium.seleniumtestcase.examples.WebTest3.php
Is there a similar function available in this library?
In order to set the firefox path for firefox portable, a few additional CapabilityType constants should be define:
const seleniumProtocol = "seleniumProtocol";
const firefox_binary = "firefox_binary";
@see https://groups.google.com/forum/?fromgroups=#!topic/selenium-users/LvB1dtAwlDs
Hi, on this line
https://github.com/Nearsoft/PHP-SeleniumClient/blob/master/SeleniumClient/WebDriverWait.php#L62
the variable $resultObject may not be defined if the previous call fails, using isset() would handle that. BTW should line 59 really be empty? I mean is it certain the exception will always be caused by waiting?
Thanks!
Hi.
Did Nearsoft abandoned the maintainance and development of this project?
I see no activity for such a long time...
For a more comfortable usage and integration, I would like to use this package in a PSR-0 compatible way, for example with dependency management like Composer.
Was wondering if this PHP binding offers/facilitates file uploads over RemoteWebDriver/Grid (a remote node), as well as FirefoxProfiles. If not, would be nice to add in those features.
Should be possible following references from:
Firefox profile section in this wiki link
https://github.com/facebook/php-webdriver/wiki/Launching-Browsers
Discussion on (remote) file uploads over JSONWireProtocol
https://groups.google.com/forum/?fromgroups=#!topic/selenium-developers/kDSygyDfqD0
if (!isset($results['value']['ELEMENT'])) throw new SeleniumNoSuchElementException();
return new WebElement($this, $results['value']['ELEMENT']);#just showing this line for reference
can we do anything about this?
$driver->waitForElementUntilIsPresent(SeleniumClient\By::id('foo');
:)
Cool library. It leaves the browser open when its done, would be nice to auto close.
When a multi-byte string is passed to webElementSendKeys, it gets split into individual bytes instead of multi-byte characters. For example, when I tried to type my name in Hebrew which is "רון", WebDriver tried to send it as six invalid characters.
This is the list of requires I have at the top of WebDriver.php and now its working
require_once DIR . '/By.php';
require_once DIR . '/DesiredCapabilities.php';
require_once DIR . '/Http/Exceptions.php';
require_once DIR . '/Http/HttpFactory.php';
require_once DIR . '/Http/HttpClient.php';
require_once DIR . '/TargetLocator.php';
require_once DIR . '/WebElement.php';
require_once DIR . '/Commands/Command.php'; #added
require_once DIR . '/Commands/Commands.php'; #moved
require_once DIR . '/WebDriverWait.php'; #added
The sniffer says:
Http: Request, POST /wd/hub/session/1351527024973/element/3/click
Command: POST
Accept: application/json
ContentLength: -1
Expect: 100-continue
HeaderEnd: CRLF
Hi,
Just wondering about this,
You have a big list of methods here, in a big comment block, but the comment doesn't give an indication where these methods are implemented or how they can be used?
For example the string "findElementByCssSelector" doesn't exist in any other php files in the SeleniumClient dir besides in this comment block of WebDriver.php.
And they're all shown with the namespace SeleniumClient\WebElement, yet they work directly on the webdriver object, for example:
require "/path/to/SeleniumClient/WebDriver.php";
$driver = new SeleniumClient\WebDriver();
$el = $driver->findElementsByCssSelector($sel); #works
?
/**
Is it possible to enable the wiki for this project, even it's purely for examples supplied by the community...perhaps linking out to snippets at https://gist.github.com
I have a basic test using click that isn't working and this is a barrier to me using these bindings at the moment, once I resolve the issue I would like to be able to share my solution/learnings for others.
By::linkText seems to me doesn't work with waitForElementUntilIsPresent
Here is small example:
$this->_driver->get("https://www.google.com/");
$this->_driver->findElement(By::id("gbqfq"))->setValue("phpunit");
$manualLink = $this->_driver->waitForElementUntilIsPresent(By::linkText("PHPUnit Manual"));
$manualLink->click();
I get SeleniumClient\Http\SeleniumUnknownErrorException : An unknown server-side error occurred while processing the command.
And on SeleniumServer
15:31:40.100 INFO - Executing: [click: null] at URL: /session/1d45438b-a2f5-4d73-bb64-a4070cf6a1b7/element//c
lick)
15:31:40.101 WARN - Exception thrown
java.lang.NullPointerException
at org.openqa.selenium.remote.server.handler.ClickElement.call(ClickElement.java:29)
at org.openqa.selenium.remote.server.handler.ClickElement.call(ClickElement.java:1)
at java.util.concurrent.FutureTask.run(Unknown Source)
at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:169)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
When I debug the code and give page time to load then it works. I see problem at WebDriver.php line 65 where $resultObject is returned (SeleniumClient\WebElement) but _elementId is NULL. When link is found _elementId is 1.
Is it bug or I should do it differently?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.