The post Install PHP (with extensions) on MacOS using Homebrew appeared first on Software QA, Functional, Automation & Load Testing with Arif.
]]>This article has detailed steps on doing clean install of PHP 7.2 (latest PHP version as of August 2018). If you already have PHP installed via homebrew, then it requires you to first remove those PHP installations and then do the fresh PHP install. Reason of doing so, is to avoid conflicts that arise because of Homebrew March 2018 updates. Further details within blog!
Recently, I wanted to include a new module (visualception) in my test automation project that is built on top of codeception. In order to successfully make it work, there was a requirement to have php-imagick
extension already installed in your system.
Initial search showed that, in past you could have installed php-imagick
extension using command like brew install php71-imagick
, but this does not work any more of Homebrew updates. With the migration to Homebrew-core
, the php formula has stopped taking over the role of PECL. So now for installation of php extensions (like imagick or x-debug) you have to use PECL.
Due to older php installations, I was getting lot of issues while trying to install php-imagick extension. Ultimately, I was able to resolve all the problems by installing PHP from scratch. In below, I have listed all the steps for fresh PHP installation.
1.1 First install xcode-command-line tools by running below command in terminal. If any popup message appears during installation, that needs to be confirmed. For further details on xcode tools, you may check this link.
xcode-select --install
1.2 As we are going to do all PHP related installations through macOS package manager Homebrew. So next we need to set it up by running below command:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Installation process will will show several prompts and may also ask for mac password. This may take a few minutes. Once it is done, you can verify the installation was successful by running below commands:
brew --version # it will return the Homebrew installed version number like .. Homebrew 1.7.2 brew doctor # it will ensure everything is configured correctly and if something is wrong then give instructions to fix
2.1 Removing all PHP-Homebrew related installations
First run below brew commands to make sure brew is updated and has no configuration issues.
brew update # updates brew itself brew upgrade # upgrades all packages installed via brew brew cleanup # by default, brew doesnot uninstall old versions. cleanup command will do the job brew doctor # Checks brew state and returns error, if there are any issues
If brew doctor or cleanup throws any errors then fix them as per instructions returned by brew-doctor or ask google
Now onto removing existing PHP-related installations (that were done by homebrew).
brew list | grep php # will show list of existing php installations done via homebrew brew uninstall --force $x # where $x = value returned by above command (brew list | grep php) rm -rf /usr/local/Cellar/php # run to ensure php dir removed rm ~/Library/LaunchAgents/homebrew.mxcl.php* # run to remove launch agents sudo rm /Library/LaunchDaemons/homebrew.mxcl.php* ps ax | grep php # checks php processes, if any still running then reboot
After above, again run brew cleanup
and brew doctor
to ensure everything working fine.
3.1 Run PHP Installation commands
brew install php # this command will install latest available version of php Or if you want to install specific versions you may run commands like below brew install [email protected] # these are version specific commands. run these if specific version required. brew install [email protected] brew install [email protected] brew install [email protected] hash -r # update bash's internal paths
Once done with above, now verify thatyou are running the correct homebrew–PHP by running type php
command. If it returns /usr/local/...anything.../php
then it means you are running homebrew-PHP. If it returns something like /usr/bin/php
then it means you are running apple-supplied-PHP. In that case you need to fix paths, as we want to use homebrew-PHP! Finally run brew doctor
to make sure everything is fine and no configuration errors are thrown.
3.2 Switching between PHP versions
If you have multiple php versions and want to switch between them, then you can do so by using brew link
and brew unlink
commands.
# Running below commands will switch php5.6 from php7.2 brew unlink [email protected] brew link --force --overwrite [email protected] brew doctor # to ensure all configs are fine php -v # verify successful relinking done # To again switch to php7.2 from php5.6 do below commands brew unlink [email protected] brew link --force --overwrite [email protected] brew doctor # to ensure all configs are fine php -v # to verify successful relinking done
3.3 Install PHP extensions
As mentioned in start, php extensions such as php-imagick or php-xdebug which were previously installed by commands like (brew install php53-imagick
) now should be installed by PECL (for details on PECL check this link). Below are example commands for installation of xdebug and imagick extension.
pecl install xdebug pecl install imagick
Now you may run php -v
to verify php version and php -m
to check enabled extensions.
The post Install PHP (with extensions) on MacOS using Homebrew appeared first on Software QA, Functional, Automation & Load Testing with Arif.
]]>The post iOS 11: What’s New & How it can Impact your Mobile App Testing appeared first on Software QA, Functional, Automation & Load Testing with Arif.
]]>In iOS 11, we have got many important updates like revamped control center, smarter Siri and multitasking abilities on iPads, In this blog, I will discuss only those updates that are most likely to impact testing of mobile apps.
1. Removal of Facebook & Twitter integration: With iOS 11 update, Apple has removed first party support for Facebook and Twitter, which were earlier integrated at system level. Previously, adding these accounts would function as a single sign-on for other apps. But that support is removed now. So, in case your Mobile App has Facebook/Twitter login feature, then it is recommended to test it and ensure that users are still able to login via web-view or native app (if installed).
2. Location permission updates: iOS 11 has significant changes on how location permissions are presented to user. In previous iOS versions, developers could choose which location permissions they wanted to show. Most of the Apps used to ask for ‘Always allow’ permission. However with iOS 11, all three options will automatically appear. User can also opt for ‘Only While using the App’ instead of ‘Always Allow’. While this might not be important for all apps, but it can definitely impact functioning of GPS and fitness tracking apps if users choose unintended option.
In addition to above, iOS 11 users will be notified If any App is excessively using GPS in background. So, it is better to ensure that App is only using GPS when required.
3. App Explanation for Location permissions: Along with three options discussed above for permission dialogue, user will also be displayed “App explanation” for all different location permission options (Always vs When-in-use). So it is important to ensure that developers have added proper “App explanations” for both these options. Because with iOS 11 ‘App explanation’ for both options will start displaying now which were not displaying previously. Any dummy data added could look really ugly on permission dialogue!
4. Drag & Drop support: Apple has made several changes in the UI. Most important is the drag-and-drop functionality which enable users to simultaneously perform multiple tasks. If app under test is developed on top of native technologies, then it should be fine. However, if the app is based on HTML5 or any other non-native platform, then there might be issues and it will better to thoroughly test it.
5. End of support for 32-bit products and Apps: It means that devices and Apps with 32-bit architecture will not work at all with iOS 11. However, the good news is that Apple has been advocating this migration since 2015. So very less number of Apps are expected to be impacted by this. You don’t need to check your app for this if any version of it was released after February 2015.
Have you already tested your App on iOS 11 or planning to do now? Please share your experience in comments and any other issues which can be observed in Apps running on iOS 11!
The post iOS 11: What’s New & How it can Impact your Mobile App Testing appeared first on Software QA, Functional, Automation & Load Testing with Arif.
]]>The post How to Install and Configure JMeter in Mac OS appeared first on Software QA, Functional, Automation & Load Testing with Arif.
]]>This blog explains the steps to install & configure JMeter in Mac OS. If you are a Windows user, then you may visit my previous blog to setup & configure JMeter in Windows.
There are multiple approaches to install JMeter on Mac. You can either do it manually just like we do it in windows or you can follow a more simplistic method to install JMeter via HomeBrew. I prefer the Homebrew method, as it gets the job done quickly with few simple commands. I will especially recommend it to those who are new to Mac OS and don’t want to go in details of manual configurations.
1. Open Mac Terminal, where we will be running all the commands.
2. In terminal, first we will run command to install HomeBrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)
At this step, It might prompt you to install mac developer tools first. Just confirm this and provide you mac password if required. Installation process will begin now and once the Homebrew installation is completed It will show success message on mac terminal.
3. Now execute following brew command to install JMeter.
brew install jmeter or brew install jmeter --with-plugins
A success message will be shown on mac terminal when the installation is completed.
4. You are ready to use JMeter now. Just type and enter JMeter in terminal to launch it. In case it does not work you can also use following command.
open /usr/local/bin/jmeter
Additional Tips for JMeter Configuration & Optimization:
(HEAP="-Xms512m -Xmx512m")
can be found in JMeter script file within bin folder of JMeter installation path (/usr/local/Cellar/jmeter/2.xx/bin/)
. Check this guide for further details on JMeter performance tuning.Let me know if this worked out well for you. If you need further help, please feel free to ask in comments section
The post How to Install and Configure JMeter in Mac OS appeared first on Software QA, Functional, Automation & Load Testing with Arif.
]]>The post How to Setup and Configure JMeter in Windows appeared first on Software QA, Functional, Automation & Load Testing with Arif.
]]>Apache JMeter is purely a Java based tool; therefore first of all we need to make sure that Java is properly installed and configured in our system. If you are already using any java based applications, then Java might already be installed on your system. To check if Java is already installed open command prompt and run command java -version.
If Java is successfully installed and configured then the command will return valid java version number (java version “x.x.x.x”) as shown in image below:
If Java is not installed or configured, then you may get a message like this: “java” is not recognized as an internal or external command, operable program or batch file.
To fix it, you need to download and install valid java JRE or JDK corresponding to your operating system. Java JRE or JDK can be download from Java Download page on Oracle website. After successful installation of JRE/JDK, open command prompt again and run the command java -version . It should now return java version number that you installed. If you still do not get the valid response after above steps, then you may look into setting java environment variables under windows system properties.
It is very important to have correct version of java on your system to get maximum out of JMeter. For example, using a 32 bit java on a 64 bit operating system can lead to under-utilization of resources.
To download JMeter simply go to official Apache JMeter website and download the zip or tgz package.
After downloading the file, just unzip it anywhere in your system. In the unzipped folder there are all the files which JMeter requires for its functioning.
There are many ways to optimize JMeter for better performance. It is a complete topic in itself but for starter, I will recommend at least configuring java xms and xmx values in JMeter.bat file. By doing so, you can make sure that JMeter is properly using the available memory resources. It also reduces the chances of OutOfMemory errors.
To change these settings, open jmeter.bat file in notepad and update following lines
// default configuration set HEAP=-Xms512m -Xmx512m set NEW=-XX:NewSize=128m -XX:MaxNewSize=128m
// new settings could be like this *depending* on your hardware and software specs // note that, Max heap size should not exceed the 80% of total system memory set HEAP=-Xms512m -Xmx2048m set NEW=-XX:NewSize=128m -XX:MaxNewSize=1024m
Other than this configuration, it is also important to use listeners intelligently in your test plan. Listeners that consume more memory like Table, Tree, Assertion and Graph listeners should be avoided during actual load test execution. It is best to only generate JTL test results file during actual load tests and later that JTL file can be used to create different reports.
There are multiple ways to start JMeter. We can start it in GUI mode by opening jmeter.bat file or we can simply run commands in CMD to execute jmeter scripts without opening it in GUI mode.
4.1) To open JMeter GUI, just navigate to apache-jmeter-2.13>bin directory and double-click ApacheJMeter.jar or jmeter.bat file.
It should open up JMeter in GUI mode as in image below:
4.2) As discussed earlier, JMeter consumes lot of system resources while running in GUI mode. Therefore, it is best to use it in command-line non-GUI mode while performing actual load tests. JMeter scripts can be executed from CMD by using command below:
jmeter -n -t myScript.jmx
Where...
–n means that JMeter will run in command line mode
-t myScript.jmx mentions the path and Filename of JMeter script
There are other parameter as well which you can pass along with command like path to JTL results file, server IP and port number etc. Command prompt will show progress messages during the script execution and also a summary after successful execution of script. You may also check additional tips for JMeter tuning in my other blog.
Still face any issues while setting up JMeter? Feel free to ask and I will try my best to help out
The post How to Setup and Configure JMeter in Windows appeared first on Software QA, Functional, Automation & Load Testing with Arif.
]]>The post Top 4 Performance Testing Tools Comparison appeared first on Software QA, Functional, Automation & Load Testing with Arif.
]]>In this blog, I will do a brief comparison of Top 4 performance & load testing tools, which are considered best by professional performance testers due to their extensive feature set, maturity level and reliable results.
Apache JMeter is an open source performance & load testing tool, which is developed and maintained by Apache. JMeter is mostly used for load testing of web services and web application servers. Testing teams are also known to use it for functional testing of web services. Following are some key points about JMeter.
a) Open-source: JMeter is open source and available free of cost; therefore many software teams prefer to use it for its cost effectiveness.
b) Components: JMeter has test elements like Thread Group, Samplers, Listeners, Pre & Post processors. Other than that, there are tons of third party free/commercial tools which can be integrated with JMeter to enhance its capabilities like JMeter Extras plugin, BlazeMeter, UBIK load pack and Loadosophia etc.
c) Platform compatibility: JMeter is compatible with Windows, Mac and all UNIX based systems.
d) Supported applications: JMeter primarily supports Java & Java server page applications. But it is also equally good to test server applications / web services / databases developed in other technologies. JMeter can also be used for load testing of mobile application server-side.
e) Reporting: In open source/free tools category, JMeter is one of most mature tools as its first was version was released in 1998 and since then there have been many upgrades to it. Thanks to continuous support it delivers reliable results. Reports generated though are very limited and teams tend to use external plugins/tools for more detailed reporting.
f) Available resources: JMeter has one of largest online community which shares helpful information with each other through different forums and software testing blogs. Because of this reason JMeter is considered a great option for beginners in performance and load testing.
LoadRunner is a commercial performance testing solution originally developed by HP and now acquired by Micro Focus. It has very advanced set of features which usually do not come built in with open-source or free tools. Some of the key points about LoadRunner are listed below.
a) Commercial tool: LoadRunner is a commercial product, falling in category of most expensive performance testing tools. Micro Focus (previously HP) LoadRunner license cost varies depending on required virtual users, protocols and perpetual licenses etc. Despite its high cost, it is still a preferable choice of enterprise testing teams because of its advanced features and dedicated customer support.
b) Components: LoadRunner is not a single application but a complete suite of tools like VU Generator, Controller, Analyzer, Load generator, Load calculator and protocol advisor.
c) Platform compatibility: LoadRunner can operate from Windows operating system or can be used as a cloud solution.
d) Supported applications: LoadRunner (performance center) provides support for widest range of applications. It can be used to test performance of databases, server side applications and native/browser based mobile applications.
e) Advanced reports: LoadRunner is best known for its very detailed reports which help a lot in analyzing the performance issues.
f) Available resources: Micro Focus provides dedicated support & knowledge base for LoadRunner to all licensed customers. Other than that, one can also find plenty of articles & video tutorials online on Micro Focus LoadRunner.
LoadUI is a load testing tool which was introduced by SmartBear after success of famous web service functional testing tool called SoapUI. LoadUI works very well when used with SoapUI for performance testing of APIs and Web services. Following are some key points about LoadUI.
a) Free & Commercial version: LoadUI comes both in free and licensed version. Free version has all the load testing features but the reporting options are limited in it. Because of this option, LoadUI is a good choice for those who want to start free of cost and later want to switch to paid version.
b) Platform compatibility: LoadUI can run from Windows operating system.
c) Supported applications: LoadUI can collect data from servers developed on top of any mainstream technology.
d) User friendly/Interactive features: LoadUI stands out in rest of performance tools because of high usability. It requires comparatively lesser time to understand and operate. Moreover it has features which give a very interactive load testing experience. Test engineer can create, configure and modify tests during the execution. Reports can be examined and analyzed as the scripts/data is changed. This enables tester to understand and trace the real performance issues.
e) Visual reports: LoadUI Pro presents reports in a very easy to understand graphical format. LoadUI free version has very limited reporting features providing only the basic reports.
f) Available resources: LoadUI team has put in a special effort to create video tutorials, blogs, and articles that can be really helpful for learning LoadUI. Sample LoadUI projects are also available on SmartBear website; that can be explored by anyone for practical understanding.
Rational Performance Tester is a performance testing solution developed by IBM. Rational Performance Tester is a commercial product just like HP LoadRunner. It is often used to test enterprise level applications like SAP, Oracle etc. Following are some major points related to IBM Rational Performance tester.
a) Commercial tool: IBM Rational Performance tester is a commercial product with very high license cost. Because of its expensive price tag it is mostly acquired by enterprises having complex performance testing requirements which cannot be fulfilled by open source or low cost performance tools.
b) Platform compatibility: IBM Rational performance tester can run on Windows, Mac and Linux AIX.
c) Supported applications: IBM RPT supports majority of applications/protocols including Web HTTP, SAP, Oracle, SOA, Citrix, Siebel and TCP. Support for additional protocols can be added by using IBM Rational Performance Tester Extensibility Software Development Kit (SDK).
d) Infrastructure requirements: IBM Rational performance tester has complex infrastructure requirements. Highly skilled and specialized resources are required to setup the test environment.
e) Code-free scripts: Rational performance tester gives ability to create code-free scripts that can be generated by recording test flows. These test recordings can also be viewed in form of rendered HTML. For advanced and customized actions, java code can be inserted anywhere in the script.
f) Available resources: IBM provides dedicated support to its licensed customers. But other than that availability of help material is quite little, if compared to other famous tools like JMeter & LoadRunner.
End Note:
When it comes to selection of best tool, then there is no straightforward best option that works for everyone. As different tools have different strengths and drawbacks, so it largely depends on factors like project requirements, availability of skilled resources and budget etc. Good amount of time should be spent on selection of right tool as this may prove to be decisive factor for getting the right results.
The post Top 4 Performance Testing Tools Comparison appeared first on Software QA, Functional, Automation & Load Testing with Arif.
]]>The post Performance Testing: Key Concepts, Issues & Testing Types appeared first on Software QA, Functional, Automation & Load Testing with Arif.
]]>To tackle these factors, it is must to have performance testing as an integral part of test plan. We can define Performance testing as “a non-functional software testing technique which determines responsiveness, stability, reliability and resource usage of system under a certain user load”.
Performance testing can be further categorized into different types; which are conducted by testing teams as per project requirements. Before going into details of performance testing types, we will first look into common performance issues found in software applications and the factors that can be used to identify these performance issues.
a) Load Time: Load time is mostly associated with the time taken by a page to load or the initial time which any desktop, mobile application takes to start completely. This time should be as low as possible. According to industry standards it should be less than 5 seconds in case of web pages and less than 5-10 seconds in case of most mobile and desktop applications.
b) Response Time: Response time usually indicates the performance of an individual transaction or query. It is the time which starts from sending a request till the time of receiving response. Lower response time indicates good performance and higher response time indicates performance issues in application which need to be traced.
c) Performance Bottlenecks: Some common performance bottlenecks are related to CPU, memory and network utilization. To trace and resolve bottlenecks different approaches and tools can be used at different levels.
Since the nature of performance issues vary from system to system; therefore we have various performance testing types which are normally performed by professional performance testers to identify performance issues. All these testing types have been given unique names as per their approaches but ultimately all these testing types come under the umbrella of performance testing.
Performance Test: A performance test is any test that can be used to measure performance, capacity, reliability, scalability and/or response/throughput time of software application.
Load Test: It is the type of performance testing which is used to understand performance behavior of any system under a specific user load for specific period of time.
In this approach, load is constantly increased on the system until the threshold value reaches. Increasing load means increasing the number of concurrent users and the transactions they are performing. This approach helps in identifying performance metrics like response time, throughput time, resource utilization etc. Similar load tests can be executed before and after code changes to check the difference in performance metrics. Such usage of load test is also termed as ‘Benchmark performance testing’.
For example, we have a load test for total 1000 concurrent users for total time span of 30 minutes. So, this test can be started from 10 users which can be constantly increased to 1000 concurrent users in time span of 30 minutes.
Stress Test: It is the type of performance test which is used to measure stability of system by testing it on its upper capacity limits and then pushing it beyond its capacity; while keeping the hardware resources constant. Because of this approach, it is considered a negative type of performance testing; as the objective here is to break the system under the extreme / unexpected conditions.
Software teams use this performance testing approach to identify the system components which fail first under soak test. These components are then tuned and optimized to either do not fail at all or recover more gracefully under extreme conditions.
Spike Test: Spike test is often considered a subset of stress test as in this form of testing; stress on system is put by increasing the number of users suddenly by a very large amount. Spike test can be defined as type of performance test; which is carried out to validate the performance characteristics of system when the load volumes are repeatedly increased beyond expected levels within short periods of time.
The objective of spike test is to determine whether the system will be able to sustain the sudden user load beyond expectation.
Soak Test: Soak test also known as endurance test, is a type of performance test in which load is put on system for a longer duration of time. Soak test duration can range from couple of hours to even a day.
Soak testing is performed because an application/server may work well for an hour or two, but may start giving issues if continuous load is exerted for a longer period of time. These issues normally arise because of memory leaks or because of hardware limitations and soak testing is very useful in finding such issues.
Capacity Test: Capacity test is a common type of performance testing which is used to determine how many users application can handle easily before its performance becomes unstable or unacceptable.
Capacity performance testing is often considered very important as it helps in determining the number of users which the application/server can handle easily. Results from capacity tests can be used to further optimize the usage of hardware resources or tune the application as per requirements.
In this blog, I did a brief overview of Performance testing and its major types. Performance testing is a vast domain and certainly there are many other areas which must be explored to understand the performance testing from its core. In future I will be exploring key software performance metrics and top performance testing tools like JMeter and LoadRunner. If you have a request for specific topic or have any feedback on this blog then do share it in comments section.
Arif Masood
The post Performance Testing: Key Concepts, Issues & Testing Types appeared first on Software QA, Functional, Automation & Load Testing with Arif.
]]>The post 2 Easy ways to set Environment variables in Linux appeared first on Software QA, Functional, Automation & Load Testing with Arif.
]]>In this blog, I will take you through the steps to set environment variables in Linux (and its flavours like Fedora). If you are looking to set environment variables in windows then visit my other blog ‘3 Easy steps to set Environment variables in Windows’. Coming back to Linux, I will use the following examples in this tutorial:
1. JAVA_HOME and JAVA Path variables (Java)
2. CATALINA_HOME (Apache Tomcat)
Before moving on to actual steps, you should know that in Linux you have option to either set environment variables permanently or for a single session. Similarly, you also have the option to set environment variables for single user or all users. Let us start from steps to set environment variables for a single session. Let’s start with most easiest but temporary way of setting these variables.
1- Temporarily set environment variables in Linux:
Setting up environment variables for single session is very easy and if you are in a scenario where you will not need to use it again then it is best choice for you. You may also use this approach if you frequently need to test in different environments using different versions of processes.
To add Java home and path variable run following commands in linux terminal:
export JAVA_HOME=/root/java/jdk-xyz export PATH=$PATH: /root/java/jdk-xyz/bin
Replace /root/java/jdk-xyz and /root/java/jdk-xyz/bin by path of JDK root and bin directory paths. You can find these paths by ‘whereis’ command or through GUI if you are using Fedora etc.
Similarly, to add Tomcat CATALINA_HOME variable, run following command on Terminal:
export CATALINA_HOME=/root/tomcat
Where ‘/root/tomcat’ is the path of apache tomcat directory in your system.
2– Permanently set environment variables in Linux:
To set environment variables permanently, we need to put commands in system files. It means that whenever Linux OS will start, these commands will be automatically executed. We can use this approach to add permanent variables for single user or all users.
For Single user:
To add permanent variables for a single user, we will need to make changes to profile file of the user. Path to this file is ‘/etc/profile’
If we have a GUI (like fedora), then we can simply navigate to this path under system files and edit it. Alternatively, we can access file by using following command in terminal…
vi /etc/profile
Once we are inside the file, we can put ‘export commands’ at end of file to add required variables. After that we can save and exit.
export JAVA_HOME=/root/java/jdk-xyz export CATALINA_HOME =/root/tomcat-xyz export PATH=$PATH:/root/java/jdk-xyz/bin
To activate new changes, we can either logout-login or run following command in terminal:
source /etc/profile
For ALL users:
To add permanent variables for all users, we will need to make changes to bashrc file which is located at ‘/etc/bashrc’
If we have a GUI, then we can simply navigate to this path under system files and edit the file. Alternatively, we can access file by using following command in terminal…
vi /etc/bashrc
Once we are inside the file, we can put export commands at end of file to add required variables. After that we can save and exit.
export JAVA_HOME=/root/java/jdk-xyz export CATALINA_HOME =/root/tomcat-xyz export PATH=$PATH:/root/java/jdk-xyz/bin
To activate new changes, we can either logout-login or run following command in terminal:
source /etc/bashrc
Verify successful addition of environment variables:
To verify new variables, you may run following commands in Linux terminal:
set echo $PATH echo $CATALINA_HOME echo $JAVA_HOME java –version
Found this blog useful? or still having issues in setting up environment variables? Feel free ask in comments. I will be pleased to help : )
The post 2 Easy ways to set Environment variables in Linux appeared first on Software QA, Functional, Automation & Load Testing with Arif.
]]>The post Introduction to Apache Tomcat for Dummies appeared first on Software QA, Functional, Automation & Load Testing with Arif.
]]>Following are some of the key points that you should know about Apache Tomcat server…
Difference between Apache HTTP and Apache Tomcat:
Apache is the name of organization that developed both Apache HTTP and Apache Tomcat. Even though these are two different tools but in real time scenarios they are often used together as they compliment each other. Following are some key points that differentiate them from each other.
Apache HTTP | Apache Tomcat |
---|---|
Apache HTTP is primarily a web server written in C | Apache Tomcat is primarily a servlet and JSP container based on Java |
Apache HTTP server is good for serving static content but it can also serve dynamic content if used with add-ons | Apache Tomcat is good for hosting servlets and JSPs but it can also host static content (though it is not preferable) |
Apache HTTP is used mostly where we have to run PHP, Perl application and CGI scripts | Apache Tomcat is used where we have to run servlets and JSPs (as they are not supported by Apache HTTP) |
Benefits of Apache Tomcat from Testing perspective:
As Tomcat can be used as a standalone PC application, therefore it can be really helpful in testing tasks where we can turn local machine into a server by Tomcat and execute any testing task.
You can find further instructions to download, install and configure Tomcat on Tomcat official page. Do try it and share your experience and feedback with us!
The post Introduction to Apache Tomcat for Dummies appeared first on Software QA, Functional, Automation & Load Testing with Arif.
]]>The post Guide to Configure NetBeans IDE for C++ appeared first on Software QA, Functional, Automation & Load Testing with Arif.
]]>1-Download the suitable version NetBeans IDE from NetBeans Download Page. You can either choose the Full version containing all components or the CPP version with components required for C/C++.
2- Install the NetBeans. It is quite simple and straight forward process to do it. If you face any difficulty let me know in comments or consult the NetBeans on site guide.
3- After the NetBeans is successfully installed, open it and check if c++ is already integrated or not.
You can check it by going to menu >>> File > New Project > and see if c++ directory is displaying or not. If it is displaying, then it means that C++ is integrated and you can move to step-5. Otherwise follow the process in step-4
4- If directory is not displaying, then it means that we need to install plugin for c++
We can do it by going to menu >>> Tools > Plugins > Available Plugins > C++
Select it and Install (Select download server of your choice and accept to agreement)
After the Plugin has been installed, restart the IDE.
5- On this stage, you can try to create a new c++ project to verify if everything is ready. While doing so you might get the following error message..
Build host is not connected. Compiler is not set for NetBeans c++.
If you observe this message, then it means that c++ compilers and tools are missing from your system and you need to install them to work with c++ projects. For installing compilers we have options to either install Cygwin or MinGW. I found that MinGW is easier to proceed so I decided to go with it. Following are the steps to install and configure MinGW…
a) Download the MinGW exe. I used following Softpedia link to download MinGw.
Once downloaded, Run the MinGW installer and choose to install the required components. I selected all of them (except MinGW make, as we will be using make from MSYS, as instructed in NetBeans official guide. We will download and configure it in later steps.). This installation process can take some time depending on net connection as some components will be downloaded during installation. After the installation has been completed add the MinGW directory to Windows Environment variables “path”.
It can be done by following these steps…
Windows> Start > Settings> Control panel> Settings > Advanced > Environment Variables.. Edit already present "path" in the list, and enter compiler directory path after a semi column ; like this.. ;C:\MinGW\bin Click OK.
If you still face any issues in setting up enviornment variables then visit my detailed blog on ‘How to setup windows environment variables’.
b) Next you need to download and install MSYS exe and run it.
To avoid any issues and conflicts, it is preferable to choose MinGW directory as the destination installation directory for MSYS.
c) After MSYS installation, next we need to install gdb Debugger. Visit this download gdb Debugger link to download it.
After all these installations are finished, restart NetBeans IDE.
Now to very ending steps:
Go to TOOLS > OPTIONS > C++ > BUILD HOST>> Press ADD button to add build host.. Browse to C:\MinGW\bin in Base Directory. Select MinGW in Tool Collection family and Tool collection Name.. (or they will automatically get selected) mingw-netbeans-add (1) Press OK.
After going through all these steps, you are ready to work with NetBeans IDE for C++. If you have any confusion in above steps or face any other issue then feel free to ask in comments.
The post Guide to Configure NetBeans IDE for C++ appeared first on Software QA, Functional, Automation & Load Testing with Arif.
]]>The post Implementing Assert and Verify logic in Selenium WebDriver appeared first on Software QA, Functional, Automation & Load Testing with Arif.
]]>In many test automation scenarios, before or after the test step we need to check if the specific text is displaying or not. We donot our test scripts to stop irrespective the result (text found or not). To achieve this objective, we have various approaches that can be used. In below I have shared some of the java code examples that can be used to implement this strategy.
if(driver.getPageSource().contains("Text - Testing with Arif")) { System.out.println("Text is Present"); } else { System.out.println("Text is not Present"); }
OR
try { assertTrue(driver.findElement(By.cssSelector("BODY")).getText().matches("^[\\s\\S]*verify text is present[\\s\\S]*$")); } catch (Error e) { verificationErrors.append(e.toString()); }
OR
driver.findElement(By.xpath("//span[contains(.,'Transaction was added successfully')]")); System.out.println("Transaction successful");
OR
try { assertEquals("VerifyText in Element", driver.findElement(By.cssSelector("div.bbMargin")).getText()); } catch (Error e) { verificationErrors.append(e.toString()); }
Similarly, in testing scenarios where we want our scripts to stop if certain assertion fails, we can use assert methods from Junit, TestNG (and other alternative frameworks) to implement the assertion strategy. In below are some examples of assertions on text.
assertTrue(driver.getPageSource().contains("1,500.00")); System.out.println("1500.00 found in page source");
OR
assertTrue(driver.findElement(By.cssSelector("BODY")).getText().matches("^[\\s\\S]*assert text is present[\\s\\S]*$"));
OR
assertEquals("1,500.00", driver.findElement(By.cssSelector("div.eoh.")).getText(); System.out.println("1500 found written in div");
OR
assertTrue(driver.findElement(By.cssSelector("BODY")).getText().matches("^[\\s\\S]*Record found successfully[\\s\\S]*$"));
OR
assertTrue(findElement(By.id("myElement")).getText().equals("foo");
Selenium WebDriver has some built-in methods that can be used with TestNG or Junit methods to implement Element verification logic. Few code examples are given below.
!driver.findElements(By.id("xyz")).isEmpty();
OR
if(isElementPresent(By.linkText("Submit"))) { System.out.println("SUBMIT Link/Button found"); } else { System.out.println("SUBMIT Link/Button not found"); }
OR
try { assertTrue(isElementPresent(By.cssSelector("div.bbMargin"))); } catch (Error e) { verificationErrors.append(e.toString()); }
IsElementPresent method from Selenium WebDriver API can be used together with AssertTrue method to implement Element assertion logic as demonstrated in code below.
assertTrue(isElementPresent(By.cssSelector("div.bbMargin")));
OR
Alternatively, If you want to assert Element Not Present, then you can use following example, which verifies that there are NO matching elements present in DOM and returns the value of zero. So when zero value is returned, assertion will pass. On other hand if there is any matching element present then zero will not be returned and assertion will fail.
Assert.assertEquals(0, wd.findElements(By.locator("locator")).size());
End Note: These are just few of the verification/assertion methods. There are many other approaches as well to do it. Have you ever used these in your test automation scripts? Or would like to recommend a better approach to our readers! Please share your thoughts and experiences in comments section.
The post Implementing Assert and Verify logic in Selenium WebDriver appeared first on Software QA, Functional, Automation & Load Testing with Arif.
]]>