Performance—responsiveness and scalability—is a make-or-break quality for software. Software Performance Engineering companies (SPE) provides a systematic, quantitative approach to constructing software systems that meets the ultimate performance objectives. It prescribes ways to build performance into new systems rather than trying to fix them later.
Software Performance Engineering is a software-oriented approach; it focuses on architecture, design, and implementation choices. Performance Engineering companies uses model predictions to evaluate trade-offs in software functions, hardware size, quality of results, and resource requirements. The models assist developers in controlling resource requirements by enabling them to select architecture and design alternatives with acceptable performance characteristics. The models aid in tracking performance throughout the development process and prevent problems from surfacing late in the life cycle (typically during final testing).
Performance Engineering Objectives:
What Does It Cost?
The cost of using SPE to proactively manage software performance depends on the size and complexity of the system under development, the level of performance risk, and the expertise and experience of the development team, as well as other factors. If not meeting your performance goals would endanger the success of your project, you have a performance risk. Factors that increase performance risk include: the use of new technologies, lack of experience in the application area, schedule, market factors, and others.
Conclusion
Performance failures occur when a software product is unable to meet its overall objectives due to inadequate performance. Performance failures negatively impact your bottom line by increasing costs, decreasing revenue or both.
The primary cause of performance failures is a reactive approach to performance during the development process. Cost and schedule pressures encourage project managers to adopt a “fix-it later” approach in which performance is ignored until there is a problem. When a problem is discovered, developers must try to “tune” the software to meet performance objectives if, indeed, they can be met.
The key to preventing performance failures and the resulting project crises is to adopt a proactive approach to performance management that anticipates potential performance problems and includes techniques for identifying and responding to those problems early in the process. With a proactive approach, you avoid the project crises brought about by discovering performance problems late and produce software that meets performance objectives and is delivered on time and within budget.
Context: Upload a file(filename.txt/tif/gif , certificate etc..) in java using selenium, tried with the attachfile Selenium api method [selenium.attachFile(fieldLocator, fileLocator)] but it is not uploading the file.
Solution: We would like to share our experience on the selenium file upload.
First we tried to upload the file using the selenium attachFile api.
void attachFile(java.lang.String fieldLocator, java.lang.String fileLocator)
where,
fieldLocator - an element locator
fileLocator - a URL pointing to the specified file
But it did not work. As we know that selenium is an automated test cases and it should run either on local machine or remote machine. Due to security restriction in the browser, JavaScript cannot fill in a path in the respective file input field by default. That’s might be the root cause of file not uploading.
After extensive search on net, got partial hint to use “type” instead of “attachFile”.
The syntax is as follows: void type(java.lang.String locator, java.lang.String value)
We unsuccessfully tried to put various appropriate file path values. Finally, we got the success when we implemented the value as file.toURI.toURL().toString().
where toURI provides the absolute path and toURL construct a URL from the URI followed by make it as string type.
Example is as follows :
// Create a file object
File file = new File(”");
// Get the absolute path of application
String pathOfApplication = file.getAbsolutePath();
// Get absolute path of the file
String absolutePathOfFile = pathOfApplication + File.separatorChar + directoryName + File.separatorChar + uploadFileName;
// Where directoryName is the directory which resides in the path of application, which contains the file to be uploaded (uploadFileName)
// Create a new file having reference of absolute path
File absFile = new File(absolutePathOfFile);
// Selenium command
selenium.type(”fieldLocator “, absFile.toURI().toURL().toString());
There may be other solutions but the above implemented solution works fine for us.
Selenium is a free open source software testing framework which provides tools to author, record, edit and play tests for automating user-interface tests for web applications. These tests can be run on most of the modern browsers and operation systems like Windows, Linux, and Macintosh. These test scripts can be written in a number of most common programming languages including C#, Java, Groovy, Perl, PHP, Python and Ruby.
PHPUnit is a unit testing framework for testing PHP applications. Selenium tests can be written using PHP language and integrated with PHPUnit framework for screen shot captures and easy reporting.
Following are steps to automate web browser testing using Selenium and PHPUnit.
Fire up Selenium IDE in Firefox browser:
(NOTE: you must have the Selenium IDE add-on installed to proceed)
Installing PHPUnit
To install PHPUnit you need to use the PEAR installer. The PEAR channel (pear.phpunit.de) is used to distribute PHPUnit so make sure that it is registered with your local PEAR environment:
Selenium RC installation
Selenium RC is a Java based command line server that starts browser and runs commands you pass from your tests.
Climax: Using PHPUnit
It is time to test our PHP script that we had exported earlier using Selenium IDE. Launch your command prompt in windows & run this command:
phpunit filename.php
where filename.php is the name of your PHP file
This will start the test. Each test command from your file will be sent to the Selenium server, which does the job of launching the appropriate browser (in our case, Mozilla Firefox), open web page and perform the same recorded actions which you performed and close the browser after the test completes.
You can also add your conditional codes in the PHP script file to add more flexibility say, to catch certain exceptions.
Things to remember for future
Also, keep in mind that the PHP file which the Selenium IDE has may contain certain HTML codes which may not work when you are executing your script. For example, you clicked on a button, Selenium recorded it, converted the action into the PHP code before exporting it to a PHP file. Now when you are running the script in PHPUnit, you may or may not encounter the error that the HTML element was not found.
In that case, you will have to manually write the correct code so your script is able to find that button in the web page when you execute it again.
Emails are an integral part of any system and thus becomes an important functionality to be regression tested. Testing emails has been difficult because of it being non real time in nature. Sometimes emails take 5-10 minutes to get into the mailbox and thus create problems.
Because of this automated regression testing emails using Selenium is not fool proof either. One of the ways to approach it is that we check the inbox for mail until a time limit of say 10 minutes and based on that complete your test case. In normal scenario mails should reach inbox within 10 minutes. Companies running their own exchange server can actually manage this more predictably..
Here is what can be followed as a concept to regression test emails:-
Let’s assume system sends an email during registration for confirming user’s email address. For testing purpose we would consider that email is being sent to your company’s email-id that is available on web.
You can put this in a loop to verify email for another 5-10 minutes and if email is not received then fail the test case.
Web Application Automation: Why open source Selenium can be a good choice?
In Agile development practice, code is evolved on daily basis with dispersed teams across globe. Maintaining quality of the product is a major concern. To maintain quality of the product continuous regression tests need to be executed to ensure predictive behavior of the product with each release. Generally companies are maintaining a set of manual test cases and run them with each product releases. With each product release new features are added and hence these test scripts are updated with new test cases and hence they becomes huge. Time of execute these huge test scripts with each product release would put adherence to the release timelines which would significantly impact time of market of the product. Hence a need arises to automate these repetitive test cycles to reduce this time and increase time to market. A good open source tool Selenium will help in automating this repetitive task. Following are advantages of using selenium over other available tools in the market.
You can find more information about Selenium and download it from below link
http://seleniumhq.org/
Selenium is one of the better options for automated functional testing of web applications and is gradually picking up the market share. We at Algoworks have identified the potential and value behind Selenium and have been utilizing Selenium as one of our main functional automation tool. We have successfully and satisfactorily automated various AJAX extensive web applications using Selenium and now it is an integral part of our QA process.
Good part about Selenium is that it is an open source free project with multiple tools designed for testing web applications. Selenium includes:
* Selenium IDE an add-on to Firefox use for recording test scripts
* Selenium RC (Remote Control) a Java server used for execution of test scripts
* Selenium Core client side testing support for web applications added directly to your application
Selenium integrates well with unit testing frameworks like NUnit and JUnit and help developers test the application as well.
Selenium is an easy to learn and a matured tool which has been utilized by industry for a few years now. You can view the job trend for Selenium on indeed.com by following the below link:-
http://www.indeed.com/jobtrends?q=selenium&l=
The graph clearly indicates how Selenium has been catching up and getting into the market. Overall, I don’t need to say Selenium has saved a lot of money for companies. Use Selenium if you would like to save some money and also enjoy the benefits of testing automation.
All the best!