You need to mock the request to the API.
Here is a PHP example: https://github.com/InterNations/http-mock/blob/master/doc/start.md
What this example does, is start a small fake http server, which always returns that data that you expect/need for the test.
You can also start a seperate mock-server manually and use that to test against. Read more at http://...
The Java Webdriver API has two methods for locating elements: findElement and findElements. findElement returns a single element matching the specified criteria (and otherwise throws an exception). findElements returns a list of matching elements, or otherwise an empty list. With the Java API, you would solve the problem by calling findElements and then ...
Yes, it definetely makes sense to use it in a language you are comfortable with.
PHPUnit has Selenium integration out of the box, did you look at the introduction in the PHPUnit manual?
Selenium has its quirks, but is widely used, so there is a lot of information about it available. There are other projects, though, like http://phantomjs.org/. If you are not ...
Take a look at SonarQube. It has some good code complexity metrics. Since code complexity generally translates to test-ability, it will give you a good idea which areas of the code need refactoring.
It also gives you some metrics on unit-test coverage. I find the historical aspect of this metric to be helpful. As code is added and/or refactored, I like ...
How about the PHP Mess Detector, it generates all kinds of metrics about the code.
Although its focus is not test-ability I think cleaning up the "mess" will lead to much better testable code. Since its a rules based system and open-source you could add more rules that are test-ability specific, maybe its possible to borrow rules from other products.
Do you have access to the original requirements?
If so, I would suggest you go back to these and build yourself a test plan. Because testing has come at the end of the process, my guess is they also haven't given you enough time to test everything (been there!). I would therefor focus on the high risk and areas of ambiguity. By which I mean, if you read ...
Maybe the test playback does not wait long enough for the element to appear, but as you do not give a lot of info about what your are testing and how its a bit of guessing work.
I would read up on how to wait for elements with Ranorex: http://www.ranorex.com/support/user-guide-20/test-automation-code-examples.html#c3197
For the manual tests, I would suggest a cradle to grave approach witrh as large a business scenario as you can find.
No idea about your business terms, but e.g.:
Create a user. Log in with the user. Do something with user profile as user like change password.
Create a customer/subscriber/item. Add account to cust/item. Add billing details. Add address. Add ...
This is my first try to setup Behat Magetest for Magento on my MacOS - my tests run quite well and I want to share my experience.
First of all you should download MAMP Pro and Magento, if you did not do it already. It works without MAMP too - but that is how I did it - so feel free to work without MAMP. My final tests are based on the sample data provided ...
You can check presence of /td or /tr tag in certain table with XPath. Do remember, that thead can have /td as well.
If the table XPath is
then XPath of each row is
and Xpath of any field could be
Additionally, you should not test it for visibility, but for presence in DOM. Visibility ...
You will need some steps to get there:
Have you repository system to notify Jenkins about the PR.
That will depend on your system. GitHub and Bitbucket have system to do it.
Build the PR branch.
Report the job status.
You can mitigate conflicts using a branching model like Gitflow, so developers can merge more frequently and only send PR without conflicts....
Jenkins is a continuous integration server, also known as a build server. It takes the source code and builds it, runs tests and execute any other commands you see fit. Afterwards it can report about the status of these commands like success and or failures.
Code analysis programs can be started and reported on with Jenkins, but this is not something that ...
As per your screen shot there is a pre-defined text that fills your flash message. So what you could do is to set up FluentWait object that would use ExpectedConditions.visibilityOfElementLocated(...).
Make sure you have ...
Optimalization of the test code is a key. Shorten, remove or replace any fixed wait states. Try to find hints on technology, you have. For example, use CSS instead of XPath, etc.
The Paralelism could help. I do not know if this is feasible in Semaphore, but you can run multiple tests at once. Especially if the time is caused by the slow application, test ...
One good implementation would be using a selenium grid and try multiple test simultaneously.
Next would be carefully debug and examine the places where it take lots of time (eg waitings, DB accessing ).If something found try to resolve that.
Another thing would be check the resource utilization of your windows PC ,common problem can be the Read Write speed ...
Some of the things you can do to improve on testing speed:
parallelize tests - some of the test runners that I've used before, like py.test and nosetests support running tests in parallel. In py.test world, there is the xdist plugin that allows to parallelize tests across CPUs and separate machines
prioritize and fail fast - make sure the critical tests are ...
IIRC, coverage.py has a module/plugin/runmode which can analyze the commit and run only tests which exercise changed code. Not sure if PHP has such runmode for coverage.
Of course it is not a silver bullet (nothing is), but it can help you to decrease test runtime. If you go that way, you may want (possibly on a separate build server) to run separate, full ...
Some ways to help in approaching this scenario would be but not limited too:
Have the majority of your automated tests at the unit/integration level (much more lightweight than e2e GUI ones)
Incorporate e2e GUI tests as effeciently as possible, add them when there is real benefit of having them and run them independently in parallel to cut down execution ...
Selenium probably is trying to get the elements before the list is visible.
After the click, try to wait:
Important: several problems occur because you copy and paste behat.yml from website to your behat.yml - there are sometimes whitespaces, that you can't see but will effect your behat system!!!
You should re-write the behat.yml, the context mentioned in behat.yml is wrong. It should be as follow.
@James From my experience, I can suggest you test plan / strategy.
Go in Pragmatic but structure is essential.
Use Risk application test matrix.
Create Test scenario matrix.
Use MoSCoW principle.
If needed involve the end user / stakeholder for review application.
Later you can review again the test plan and strategy and make improvement from past ...
This doesn't sound like code you'd want to unit test, since the purpose of it seems only to be interacting with a database. What you want here is integration testing which will verify that parts of your system work together correctly. CRUD tests like this are pretty common integration tests in my experience.
It is possible that there is something worth unit ...
You need to run selenium server before you execute your test cases.
Try following steps:
Open Terminal / CMD.
Navigate to directory where your selenium-server-standalone-2.33.0.jar is stored.
E.g: cd /User/Documents/Selenium
Execute following command to run the server
java -jar selenium-server-standalone-2.33.0.jar
This will start selenium server.
I've handled this before by killing the process with driver.quit(); and then re-initializing the driver and getting the URL. That will definitely kill the session, because it's running in a new JVM. Since it's the same test, you can still pass strings and integers to the new driver.
driver = new firefoxdriver();