Powered By Blogger

Search Here!

Showing posts with label Testing. Show all posts
Showing posts with label Testing. Show all posts

Tuesday, June 15, 2021

Setup Automated Mobile Test Build Parameters in Jenkins !

Jenkins File -

properties([ 
disableConcurrentBuilds(),
buildDiscarder(logRotator(numToKeepStr: '25')),
parameters([
string(defaultValue: "localhost", description: 'Server Login IP address', name: 'LOGIN-IP-VALUE'),
choice(choices: ['All','Smoke','Regression'], description: 'Test Suite Name', name: 'Test_Suite_Name'),
choice(choices: ['emulator','device'], description: 'Device Type', name: 'DEVICE_TYPE'),
extendedChoice(name: 'Slave', value: 'Manish,Evan,Max', defaultValue: 'Manish', description: 'Slave Machine Name', type: 'PT_MULTI_SELECT', visibleItemCount: 2)
])
])

node("${env.Slave}") {
stage('Checkout') {
timestamps {
checkout scm
}
}

stage('Test') {
timestamps {
try {
bat 'python.exe -m robot --variable LOGIN-IP-VALUE:%LOGIN-IP-VALUE% --variable DEVICE_TYPE:%DEVICE_TYPE% -d Output -i %Test_Suite_Name% --loglevel TRACE Tests/'
} catch (Exception e) {
emailSubject = "Jenkins build Failure: ${JOB_NAME} #${BUILD_NUMBER}"
emailRecipients = [[$class: 'DevelopersRecipientProvider'], [$class: 'RequesterRecipientProvider']]
emailBody = """
<style>
table {border:1px solid #ccc}
th {border:1px solid #ccc}
td {border:1px solid #ccc}
</style>
<table>
<tr><th>Result</th><td>${e}</td></tr>
<tr><th>Name</th><td>${currentBuild.fullDisplayName}</td></tr>
<tr><th>Job URL</th><td><a href="${JOB_URL}">${JOB_URL}</a></td></tr>
<tr><th>Build URL</th><td><a href="${BUILD_URL}">${BUILD_URL}</a></td></tr>
</table>
""".stripIndent()
emailext attachLog: true, mimeType: 'text/html', subject: emailSubject, body: emailBody, recipientProviders: emailRecipients
throw e
} finally {
stage('Generate report') {
publishHTML([allowMissing: false,
alwaysLinkToLastBuild: true,
keepAll: true,
reportDir:'Output',
reportFiles:'report.html',
reportName:'Mobile Integration Test Report'
])
}
                        }
                }
        }
}

Preview in Jenkins -

As per my assumption out tests should be enough capable to run on the given environment -

LOGIN-IP-VALUE - Execute test's on given IP address.
Test_Suite_Name - Execute tests based on selected types of scenarios.
DEVICE_TYPE - Using emulator or on the real device connected via USB.
Slave - Execute test on different machines based on user identity.


Monday, June 14, 2021

Mobile Device Testing using AWS Device Farm !

Device Farm is an app testing service that you can use to test and interact with your Android, iOS, and web apps on real, physical phones and tablets that are hosted by Amazon Web Services (AWS) since 2015.

  There are two main ways to use Device Farm:

  • Automated testing of apps using a variety of testing frameworks.

  • Remote access of devices onto which you can load, run, and interact with apps in real time.


Ways to use Device Farm


Automated Testing Vs. Remote Access

Automated Testing Vs. Remote Access


Problems will solve?
  • The cost and complexity of effective testing is growing
  • Maintain device on lab
  • Manual testing on each device is not practical
  • Record to trace the testing issue

Free Edition Limits in AWS Device Farm?
  • Mobile App package size < 4 GB .
  • Remote Access/ Automated testing only allow 1 hour at most each Session.
Pricing?

Pricing


Wednesday, August 25, 2010

API Testing Techniques !

What is API?
An API (Application Programming Interface) is a collection of software functions and procedures,
called API calls, that can be executed by other software applications.
What is API Testing?
API testing is mostly used for the system which has collection of API that needs to be tested. The
system could be system software, application software or libraries.

API testing is different from other testing types as GUI is rarely involved in API Testing. Even if GUI
is not involved in API testing, you still need to setup initial environment, invoke API with required
set of parameters and then finally analyze the result.
Setting initial environment become complex because GUI is not involved. In case of API, you need
to have some way to make sure that system is ready for testing.

This can be divided further in test environment setup and application setup. Things like database should be configured, server should be started are related to test environment setup. On the other hand object should be created before calling non static member of the class falls under application specific setup.

Initial condition in API testing also involves creating conditions under which API will be called. Probably, API can be called directly or it can be called because of some event or in response of some exception.
Test Cases for API Testing:

The test cases on API testing are based on the output.
• Return value based on input condition
Relatively simple to test as input can be defined and results can be validated.
Example: It is very easy to write test cases for int add(int a, int b) kind of API. You can pass
different combinations of int a and int b and can validate these against known results.
• Does not return anything
Behavior of API on the system to be checked when there is no return value.
Example: A test case to delete(ListElement) function will probably require to validate size of
the list or absence of list element in the list.
• Trigger some other API/event/interrupt
The output of an API if triggers some event or raises some interrupt, then those
events and interrupt listeners should be tracked. The test suite should call
appropriate API and declarations should be on the interrupts and listener.
• Update data structure
This category is also similar to the API category which does not return anything. Updating data structure will have some effect on the system and that should be validated.
• Modify certain resources
If API call is modifies some resources, for example makes update on some database, changes registry, kills some processes etc, then it should be validated by accessing the respective resources.

API Testing Approach

An approach to test the Product that contains an API.
Step I: Understand that API Testing is a testing activity that requires some coding and is usually
beyond the scope of what developers are expected to do. Testing team should own this activity.
Step II: Traditional testing techniques such as equivalence classes and boundary analysis are also
applicable to API Testing, so even if you are not too comfortable with coding, you can still design
good API tests.
Step III: It is almost impossible to test all possible scenarios that are possible to use with your
API. Hence, focus on the most likely scenarios, and also apply techniques like Soap Opera Testing
and Forced Error Testing using different data types and size to maximize the test coverage.
Main Challenges of API Testing can be divided into following categories.
• Parameter Selection
• Parameter combination
• Call sequencing

API Framework

The framework is more or less self-explanatory. The purpose of the config file is to hold all the configurable components and their values for a particular test run. As a follow through, the automated test cases should be represented in a ‘parse-able’ format in the config file. The script should be highly ‘configurable’.

In the case of API Testing, it is not necessary to test every API in every test run ( the number of API’s that are tested will lessen as testing progresses). Hence the config file should have sections which detail which all API’s are “activated” for the particular run. Based on this, the test cases should be picked up.

Monday, August 23, 2010

Testers: Site Migration Checklist !

Nowadays, QA required and responsible for coordination in Release Management for own accountability of quality and timeliness of project delivery. How do you even get started to test for a Web Site that has been migrated? Of course, QA wants to have strong Web Strategy and Testing Team in place. Probably another useful step is to just get a feel for the overall scope or checklist of a migration, before diving into any particular details (or just starting without planning). Perhaps this one page checklist will help your planning by providing some ideas of the scope of migration planning for testers.

  • Navigation - Link Verification.
  • Randomly browse the site (internal links) to look for any wrong behavior.
  • SSL verification.
  • Form submissions & page redirections.
  • Images/documents verification.
  • Data verification.
  • Character encoding.
  • Links/references in emails / messages.
  • File uploads - permissions & paths verification.
  • An email, site URL details correctly set in configuration.
  • Write permissions on all uploaded directories.
  • Functional verification affected due to migration.
  • Data cleansing.

Sunday, August 22, 2010

How to hire the right candidates for software testing positions?

Do companies really judge candidate’s testing ability in interviews? Do they ask the questions that really judge the candidate’s skill? What questions should be asked to judge the candidate for software testing field? What is the key process to hire good candidates for software testing positions?
Ok, I am asking to many questions without giving answer to any of it. Well, each question mentioned above will require a separate post to address the problem fairly. Here we will address in short about – How to hire the right candidates for software testing positions?
Companies or interviewers, who are not serious about hiring right candidates, often end with hiring poor performers.
What I mean by “Not serious” here? 
- They don’t know why and for what post they are hiring a candidate.
- They either fake or fail to post the exact job opening details.
- Or they don’t want to hire skilled performers at all. Hmm, jealousy might be the key here!
Whichever is the reason, there is definitely loss of organization. Loss in terms of both revenue and growth.
Do not forget to comment your experience on software testing interviews, either as an interviewer or as a candidate.

SQL Injection – How to Test Web Applications against SQL Injection Attacks !

Security testing of web applications against SQL Injection, explained with simple examples –
Many applications use some type of a database. An application under test might have a user interface that accepts user input that is used to perform the following tasks:
1.    Show the relevant stored data to the user e.g. the application checks the credentials of the user using the log in information entered by the user and exposes only the relevant functionality and data to the user
2.    Save the data entered by the user to the database e.g. once the user fills up a form and submits it, the application proceeds to save the data to the database; this data is then made available to the user in the same session as well as in subsequent sessions
Some of the user inputs might be used in framing SQL statements that are then executed by the application on the database. It is possible for an application NOT to handle the inputs given by the user properly. If this is the case, a malicious user could provide unexpected inputs to the application that are then used to frame and execute SQL statements on the database. This is called SQL injection. The consequences of such an action could be alarming.
The following things might result from SQL injection:
1. The user could log in to the application as another user, even as an administrator.
2. The user could view private information belonging to other users e.g. details of other users’ profiles, their transaction details etc.
3. The user could change application configuration information and the data of the other users.
4. The user could modify the structure of the database; even delete tables in the application database.
5. The user could take control of the database server and execute commands on it at will.
Since the consequences of allowing the SQL injection technique could be severe, it follows that SQL injection should be tested during the security testing of an application. Now with an overview of the SQL injection technique, let us understand a few practical examples of SQL injection.
Important: The SQL injection problem should be tested only in the test environment.
If the application has a log in page, it is possible that the application uses a dynamic SQL such as statement below. This statement is expected to return at least a single row with the user details from the Users table as the result set when there is a row with the user name and password entered in the SQL statement.
SELECT * FROM Users WHERE User_Name = ‘” & strUserName & “‘ AND Password = ‘” & strPassword & “’;”
If the tester would enter John as the strUserName (in the textbox for user name) and Smith as strPassword (in the textbox for password), the above SQL statement would become:
SELECT * FROM Users WHERE User_Name = ‘John’ AND Password = ‘Smith’;
If the tester would enter John’– as strUserName and no strPassword, the SQL statement would become:
SELECT * FROM Users WHERE User_Name = ‘John’– AND Password = ‘Smith’;
Note that the part of the SQL statement after John is turned into a comment. If there were any user with the user name of John in the Users table, the application could allow the tester to log in as the user John. The tester could now view the private information of the user John.
What if the tester does not know the name of any existing user of the application? In such a case, the tester could try common user names like admin, administrator and sysadmin. If none of these users exist in the database, the tester could enter John’ or ‘x’=’x as strUserName and Smith’ or ‘x’=’x  as strPassword. This would cause the SQL statement to become like the one below.
SELECT * FROM Users WHERE User_Name = ‘John’ or ‘x’='x’ AND Password = ‘Smith’ or ‘x’=’x’;
Since ‘x’=’x’ condition is always true, the result set would consist of all the rows in the Users table. The application could allow the tester to log in as the first user in the Users table.
Important: The tester should request the database administrator or the developer to copy the table in question before attempting the following SQL injection.
If the tester would enter John’; DROP table users_details;’—as strUserName and anything as strPassword, the SQL statement would become like the one below.
SELECT * FROM Users WHERE User_Name = ‘John’; DROP table users_details;’ –‘ AND Password = ‘Smith’;
This statement could cause the table “users_details” to be permanently deleted from the database.
Though the above examples deal with using the SQL injection technique only the log in page, the tester should test this technique on all the pages of the application that accept user input in textual format e.g. search pages, feedback pages etc.
SQL injection might be possible in applications that use SSL. Even a firewall might not be able to protect the application against the SQL injection technique.
I have tried to explain the SQL injection technique in a simple form. I would like to re-iterate that SQL injection should be tested only in a test environment and not in the development environment, production environment or any other environment. Instead of manually testing whether the application is vulnerable to SQL injection or not, one could use a web vulnerability scanner that checks for SQL injection.

Friday, December 4, 2009

Security Testing !

We are introducing new security system checks on the website to get rid from the hackers.

1) Security Testing:
Following are some test cases for web security testing:
  • Test by pasting internal url directly into browser address bar without login. Internal pages should not open.
  • If you are logged in using username and password and browsing internal pages then try changing url options directly. I.e. If you are checking some publisher site statistics with publisher site ID= 123. Try directly changing the url site ID parameter to different site ID which is not related to logged in user. Access should denied for this user to view others stats.
  • Try some invalid inputs in input fields like login username, password, and input text boxes. Check the system reaction on all invalid inputs.
  • Test the CAPTCHA for automates scripts logins.
  • Test if SSL is used for security measures. If used proper message should get displayed when user switch from non-secure http:// pages to secure https:// pages and vice versa.

2) Cookies Testing:
Cookies are small files stored on user machine. These are basically used to maintain the session mainly login sessions. Test the application by enabling or disabling the cookies in your browser options. Test if the cookies are encrypted before writing to user machine. If you are testing the session cookies (i.e. cookies expire after the session’s ends) check for login sessions and user stats after session end. Check effect on application security by deleting the cookies.