Tagged Questions
11
votes
1answer
429 views
“Could not connect to the Selenium RC server” after some time of executing script
I have got a test case in my test class and some problems with it. I run the script from console. The script is executed to a certain point and then the test fails with error:
Could not connect to ...
5
votes
2answers
2k views
What is the best way to assert redirections in Selenium?
I am writing a selenium test and I need to assert that the page is redirected. How should I verify this? What would be the best way?
I am using PHPUnit and the PHPUnit_Extensions_SeleniumTestCase.
5
votes
2answers
209 views
How to execute choice of test cases from multiple test cases
I want to execute few selected test cases from my class of multiple test cases using php unit with ease.
As my 1-2 test cases are failing from bunch of test cases and also finding difficult to ...
4
votes
3answers
1k views
How to access a stored value in PHPUnit_Extensions_SeleniumTestCase
How can I store a value within Selenium-RC (through PHPUnit) and then retrieve/access it later using PHPUnit?
Suppose I run a command like the following in a test:
$this->storeExpression( "foo", ...
3
votes
3answers
6k views
Selenium: How to select an option from a select menu?
I am writing a Selenium test in PHP using the PHPUnit Selenium extension.
I know how to type something into a text field:
$this->type('fieldName', 'value');
But how do I select an option from a ...
3
votes
2answers
2k views
PHPUnit Selenium captureScreenshotOnFailure does not work?
I am using PHPUnit 3.4.12 to drive my selenium tests. I'd like to be able to get a screenshot taken automatically when a test fails. This should be supported as explained at ...
3
votes
1answer
541 views
Using glob in the Selenium extension to PHPUnit to identify elements
I'm writing a Selenium test case in PHPUnit using the Selenium extension. In the test, I assert that a certain link is present on the page.
For example, say I want to assert that the following link ...
3
votes
2answers
305 views
PHPUnit extension Selenium 2 (webdriver) and multiple browsers
I wrote a test case with PHPUnit extension Selenium2TestCase. It does work nice, but I can't figure out how make automatically run this test on various browsers.
There is a method setBrowser() which ...
2
votes
6answers
2k views
Selenium: How to enter white space as the value of a text field?
I have a form text field that is being populated with a default value. I would like to clear the value and enter white space to assert that the expected validation occurs. I am using Selenium RC and ...
2
votes
2answers
571 views
Start Selenium RC server automatically
How can I automatically start and stop the Selenium RC server when I run my phpunit tests?
I thought I could create a little bash script that does something like this (does not work though):
java ...
2
votes
3answers
596 views
Get the Nth element with XPath - when element[N] fails
There were already some discussion about the Nth element in XPath:
XPath query to get nth instance of an element
Get Nth child of a node using xpath
XPath and PHP: Parse from the nth instance of ...
2
votes
1answer
317 views
Selenium test timeout doesn't stop the test PHPUnit 3.6.10 Selenium RC 2.19.0
When a test tries to open a page that doesn't load, and the timeout value is reached, the test doesn't stop or throw an exception. Instead it just moves on and acts as if the page is loaded ...
2
votes
1answer
201 views
Group/Filter in phpunit doesnt execute specific test case
i have a suite that calls multiple suites and many functions for LOG,REPORT and Execution if i m trying the same 'Group or Filter' pattern its executes all the test cases without executing the ...
2
votes
1answer
6k views
Selenium RC throws sessionsid should not be null exception with assertTextPresent, phpunit 3.4 bug only?
I am looking to migrate my selenium RC tests to using PHPUnit 3.4.12 from PHPUnit 3.3.2
The selenium test will fail with an exception of the following when I use assertTextPresent()
...
2
votes
1answer
2k views
Selenium: How to assert that a text field is disabled?
I am using the PHPUnit Selenium Extension for Selenium RC.
I am able to assert the field is present:
$this->assertElementPresent('Date');
But how do I assert that the field is disabled (or not ...