Tuesday, 29 May 2018

Postman: chaining requests

Most people already know how to send a lone request using Postman. Send it off, inspect the response you get from the server. Make some adjustments, and then try it again.
That’s all well and good. However, when you save one or more requests to a collection, you can start using some of the more advanced features in Postman. For example, with Postman, you can write scripts that run before and/or after you send your request and receive a response from the server.
There’s a lot more you can do with these scripts.
  • Do setup and teardown for testing. For example, you can do calculations to use in the main request or send asynchronous requests. Tests scripts are the cornerstone of testing in Postman – to validate your endpoint is working as expected.
  • Direct the next request to be called based on the results of the server response. Using basic JavaScript, you can then use postman.setNextRequest("Request name") to guide the sequence of the remaining API calls.
  • Extract data from the response. This can be useful to capture session or cookie data or parse information available within the response body to chain requests. In this tutorial, we’ll dig deeper into this scenario.

Set up a Bitcoin tracker

Have you heard of Bitcoins?!? It's one of many cryptocurrencies based on blockchain technology, something about maths, and… well, there's probably more I should know about that. What I did know, however, is someone who accidentally purchased 200 Ethereum (another cryptocurrency), instead of $200 worth of Ethereum. With this fortunate mistake, he made enough money to pay for his son's college tuition over the course of 2 weeks  
How can you make money when the price of Bitcoins are so volatile? Turns out, you can make money because the price of Bitcoins are so volatile.
I had serious fear of missing out (FoMO), and wanted to gamble on invest in Bitcoin too! The next time the price of Bitcoin fell to a reasonably low rate, I planned to fill my coffers with Bitcoins like Scrooge McDuck.
Let's walk through how to extract data from a response and chain together requests. 
  1. Create and select an environment.
    • For this example, we’ll create and select a new environment. We’ll use this environment to store and access our environment variables. Update the values using your own Twilio API credentials. We'll be using the Twilio API to send ourselves an SMS when the price of Bitcoin falls to certain price. Sign up for a Twilio test account if you don't already have one.
  2. Send a GET request, extract data from the response, and store as an environment variable.
    • Send a GET request  to https://api.coindesk.com/v1/bpi/currentprice.json using Postman. This request returns a JSON body. Remember to save this request to a collection. We'll see why this is important in just a bit.
    • Under the Tests tab, add the following JavaScript. The important thing to know here is that we can access the JSON response body using pm.response.json(), and then parse the response object to extract the current Bitcoin rate. Then we can store this value as an environment variable using pm.environment.set("rate", usdRate) where "rate" is the name of our environment variable and usdRate is the value that we'll store as this variable. 
    • After we hit Send, click on the Quick Look icon to see that we’ve extracted the data from the response body, and saved it as an environment variable. Now, we can use this variable in our next request.
    • In the same manner, can you figure out how to extract the "time" from the response, and then save it as an environment variable?
  3. Send a POST request using a stored environment variable. 
    • For this second request, we will use the Twilio API to send an SMS. Send a POST to https://api.twilio.com/2010-04-01/Accounts/{{twilioAccountSID}}/Messages.jsonwhere {{twilioAccountSID}} is your own Twilio Account SID. Remember to also save this second request to our collection.
    • String substitution: we can use the double curly braces syntax anywhere we would normally input text, like {{variable-name}}, to use a variable. Postman will access the variable's value and swap in the value as a string. Use the double curly braces in the URL, parameters, or any of the other data editors.
    • More String Substitution: this request requires the authentication credentials we saved to our environment in the first step. We can use the same double curly braces syntax in Postman's auth helper to handle Basic Auth for the Twilio API. Authentication (and scripts) are available for entire collections and folders too.
    • Special note about accessing variables in scripts: there's a different way to access variables in the script sections since we're writing JavaScript, instead of text. Under the pre-request or tests script tabs, use pm.variable.get("variable-name").
  4. Run the collection
    • Instead of sending your requests one at a time, you can run every request in the collection in one go. Run the collection locally with collection runner in the Postman app or with the Newman command line tool. Alternatively, you can run the collection and environment on the Postman cloud as a monitor.
Postman Tip: you can send these requests in the default, ordered sequence, or you can write a script to execute these calls in a specified sequence using postman.setNextRequest("Request name") or to terminate the remaining collection run using postman.setNextRequest(null). In this manner, you can build a sequence of API calls that mirror your use case.

Try it yourself

Click the orange Run in Postman button to import the Bitcoin Tracker collection and environment into your Postman app. 
Run in Postman
  1. Enter your Twilio credentials: You will need a Twilio Account SID to update the twilioAccountSID value within the Postman environment. You will need a Twilio Auth Token to update the twilioAuthToken value within the Postman environment.
  2. Enter a target rate: In this example, set a target rate by updating the targetRate value within the Postman environment. If the current Bitcoin rate drops below this target, like in a flash crash, the POST request to the Twilio API will be called.
  3. Run it: Run the collection and environment locally using the Postman collection runner.

Need help getting started? Check out the documentation for the Bitcoin Tracker, and follow along with step-by-step instructions, examples of responses, and helpful screenshots.


Monday, 14 May 2018

30 Days of E-Commerce Testing -Day 15-Name five different online payment methods.


Name five different online payment methods.
When you run a global business, you may want to integrate credit cards to collect payments, however, you will find most countries have their own popular local payment methods.
  • American like paypal and credit card.
  • Chinese prefer e-wallet Alipay

  • In Germany, the major local payments are online banking sofortBanking, Giropay, and Paysafecard.
  • Dutch like iDeal
  • Polish use Dotpay
  • Arab prefer E-wallet like CashU.
  • Russia, people like E-wallet like Qiwi, Yandex.Money, Webmoney and cash.
  • Online banking transfer is more popular in South East Asia.
  • People in Brazil prefer Boleto

Sunday, 13 May 2018

30 Days of E-Commerce Testing -Day 13-Share three testing ideas for an ecommerce website.

Share three testing ideas for an eCommerce website.

Function test:


1 Continue shopping
At the ‘my cart’ page, users should be given the option to add more items to the cart in case if they want to buy more items before checkout. To test the site with this function to make sure it works.

2 Search results page
Search for the items is a commonly used function. At search page, the sort order is important. In my opinion, a user generates search order like ‘top-rated’, ‘best sellers’, ‘price’(low to high or high to low) etc. should be tested.


Performance test:


3 Generally speaking, there might have a large amount users login or checkout simultaneously, testing concurrent of login API and check out API is essential to make sure the website could work stably under the a certain concurrent. 

Saturday, 12 May 2018

30 Days of E-Commerce Testing -Day 12-Create a mindmap of what ecommerce testing means to you and share it!





30 Days of E-Commerce Testing -Day 11-Test a “my cart” page from different user persona’s perspectives, share your personas!

Test a “my cart” page from different user persona’s perspectives, share your personas!

Here are my personas for the cart, and I separate people into three age group, that is three personas young people, middle age, and elderly persons.

Persona 1: For young people, they catch up new things and technologies and like all the things that fancy and fashionable. So the cart should be cool and display all the thing that in order. As a young people,  the cart page should be loaded fast and UI should be attractive.

Persona 2: As middle age person, normally they have the family to feed and they are price sensitive. So at the cart page , uses promotions and coupons where possible.

Persona 3: For the elderly people, they are not involved a lot with the internet, and most of the time asks for help to others.  So they would be grateful to have a user-friendly interface and an intuitive page. A help window at cart page would be helpful for getting them out of troubles.

Thursday, 10 May 2018

30 Days of E-Commerce Testing -Day 10 - An ecommerce system has been launched, you have to do a smoke test. Share what you would test.

10 An ecommerce system has been launched, you have to do a smoke test. Share what you would test.

Smoke testing or Build Verification Testing, is a type of software testing that comprises of a non-exhaustive set of tests that aim at ensuring that the most important functions work. The results of this testing are used to decide if a build is stable enough to proceed with further testing.

As for the eCommerce system, I’d like to list all the key features ordered by the process how a user operate when shopping online, the key features should include the following:

1 Main page UI display

2 Registration page UI and registration function

3 Product description page UI

4 Add to shopping cart function

5 Shopping cart page display

6 Check out process function

7 Payment processing function

8 Order tracking function

9 Logout function

I think if all these functions are checked and verified, then can move to the formal testing process.

Tuesday, 8 May 2018

30 Days of E-Commerce Testing -Day 9- Share your three favourite tools for testing ecommerce products on The Club.

Share your three favourite tools for testing ecommerce products on The Club.


1. Selenium
A testing framework for web applications on platforms like Linux, Mac and Windows, Selenium is also used to test browser compatibility. Developers can test in a number of languages such as Java, Groovy, PHP, Ruby, C#, Python and Perl. Selenium is part of most major browsers including Firefox and Chrome.

2. Jenkins
Jenkins is a continuous integration (CI) tool for resting code base changes in real time. It lets you detect and resolve code base problems quickly and automate build testing. An open-source program, it was forked from the Hudson project. Jenkins runs on servers in a container, and supports version control tools such as Perforce, Git and Subversion.

3. GitHub
GitHub is a version control repository used by millions of developers. Many software testing tools can be linked to GitHub accounts, so reported defects are automatically recorded. For example, you might run manual tests on the testing tool while using GitHub for bug tracking.

4. HP LoadRunner, StormRunner and Performance Center
HP’s LoadRunner provides end-to-end system performance testing for agile and DevOps to help you identify and rectify problems before going live. Performance Center helps you plan and run tests for multiple projects. It has new open-source integrations to improve team collaboration. StormRunner Load is a SaaS load and performance testing tool designed for planning, executing and scaling mobile and web tests.

30 Days of E-Commerce Testing -Day 8-On an ecommerce platform, what monitoring and analytics would implement and why?

On an eCommerce platform, what monitoring and analytics would implement and why?
Generally speaking, there are about 6 modules in the e-commerce platform, and in each module, there are something that the company should to analyses and monitoring.
1 Operational module
1.1  Traffic analysis and monitoring:
By analyzing and monitoring the patterns and structure of the flow patterns, we know the peak of traffic which can support the arrangement of promotion activities.
1.2  Price monitoring and analysis:
It is possible to obtain industry prices through crawler technology and analyses the prices of the industry so as to achieve effective price control.
2        Sales module
2.1  Order tracking analysis:
Orders: who at what time sold what to whom at what price to where. By analyzing the data, we can get the time of the order, price range and geographical distribution of customers. It can be inferred that those products are most popular and customers in what cities have the strongest purchasing power.
3        Commodity module
3.1  Procurement monitoring and analysis:
Including supplier data analysis, procurement matching analysis, etc.
3.2  Inventory monitoring and analysis:
Data analysis of commodity inventory days, stock-to-sales ratio, etc. these data can be used to judge the value of commodities and assist in the adjustment of commodity strategies
3.3  Abnormal commodity analysis:
Including the analysis of the data such as return rate, damaged rate, abnormal goods, etc. So that the after-sales department can deal with these orders as soon as possible to improve the service level.
Those are what I can think about at the moment, Thanks.

30 Days of E-Commerce Testing -Day 5-Identify different types of ecommerce business classifications/models

Identify different types of ecommerce business classifications/models
  1. B2B – Business to Business
  2. B2C – Business to Consumer
  3. C2C – Consumer to Consumer
  4. C2B – Consumer to Business



Monday, 7 May 2018

30 Days of E-Commerce Testing -Day 6- If you were testing a “my cart” webpage, what three test cases would you perform first? Share them!

Simply put:
1 When click my cart button on the previous page, the 'my cart' webpage should be load and display properly.
2 On the cart webpage, the display content and page layout should meets the requirements those were set before.
3 Try to add some items to the cart, and check the items aattributes (such as number, color, classification and so on....) are all correct.

30 Days of E-Commerce Testing -Day 7- Name five examples of an ecommerce platform?

1 Amazon
2 eBay
3 Taobao (China)
4 JD (China)
5 hey.shop (China)
6 mmmseo (China)

30 Days of E-Commerce Testing -Day 4-Find and share a useful video on youtube about ecommerce testing.

How to test E-commerce website

There are a total of 4 episodes

https://www.youtube.com/watch?v=fvShwPY0ACI&index=0&list=PLsvh2FHVJ4qYXEcflsyFEbjobyUZLDajx

30 Days of E-Commerce Testing -Day 2-Read and share an interesting blog about ecommerce testing.

From: https://crossbrowsertesting.com/blog/ecommerce/exploratory-testing-techniques-e-commerce/


Exploratory Testing Techniques for Your E-Commerce Site


exploratory testing techniques ecommerce website testing
Though test automation has been a saving grace for when checking previously written code coverage, we know that there is no substitute for manual testing. Whether you follow the traditional waterfall method or are practicing agile development with your team, exploratory testing plays a critical role.
Anyone who owns or manages an e-commerce website especially knows this to be true. What’s the use of automating a script you derived out of thin air? Instead, exploratory testingwith real, human testers provides insight into functionality, performance, and usability of the application.
In order to better understand some of the most important areas to cover when conducting exploratory tests on an e-commerce site, we put together a few steps to consider when live testing.
  1. What happens when someone tries to log in? Is the user directed to the correct page after they logged in and does it load properly? What happens if they put in the wrong information — do they have to re-enter email and password every time or does it stay in the field? What do any error messages say and is it easy to retrieve a forgotten password or use existing login data? Whether your web application prompts a login as soon as someone lands on the home page or just in order to log into their account at payment, you want this to be a seamless experience because if someone has trouble logging in, there’s a good chance they won’t end up purchasing.
  2. How user-friendly are the form fields? If your website is good enough that a customer can easily make it to check out, you don’t want to trip them up on the last few steps of their purchase as the fill out form fields like name, address, and payment information. Unfortunately, however, this is still something many websites have yet to master. Are you asking too much information or not enough? How long does it take to get one from their shopping cart to a finished checkout? Make sure that promotion boxes and purchase total calculations function correctly. Additionally, you’ll want to make sure that all payment processing works, so that customers who are trying to use PayPal won’t encounter an issue that someone charging to their credit card wouldn’t get.
  3. What’s the experience like on mobile? Speaking of form fields, they can pretty much make or break the mobile user experience. You want to make sure that each field takes up most of the screen when a user goes to fill it in, or someone going through checkout might become frustrated at how hard it is to see and type their information to make the purchase. You’ll generally want to make sure the website design is responsive, which may mean implementing different types of features and designs for users that do not access the site on a desktop in order to make it easier to use and look at. Consider all the ways that the buying process differs with a touch screen and a scaled down keyboard. Of course, it’s best to test for mobile on a few real devices to truly understand how these different functions come into play.
  4. How long do different pages take to load? First of all, you want your homepage to load quickly because this is where new and returning traffic will start, and you want to make a good first impression. However, you also have to consider other areas of your application that don’t get the same level of traffic but are equally as important. Does the last product page load as fast as the first or second one? Do some categories perform better than other? What happens in the shopping cart — is the site laggy when it tries to process a user’s input information? Basically, where does the site trip up that could affect the buyer’s journey and deter them from fulfilling their purchase? Don’t forget about load and performance testing.
  5. What happens when you abandon the site and come back? How much progress does the page save and for how long? What about if the page is reloaded? Will someone be logged out or have their cart emptied if they leave for a few minutes? You have to consider the fact that not every user will have the same consistent experience with your application from beginning to end. They might view a product on multiple devices or keep the tab open while they check your competition, and you would hate to lose them when they come back to buy because you haven’t made it easy enough to pick up where they left off.
  6. What could be better from a usability perspective? You know what they say — if it’s not broken, don’t fix it. Except, this isn’t necessarily true when you’re talking about developing and testing a web application. Just because you don’t find a bug in your exploratory tests, doesn’t mean there’s no feedback to give the developers. Consider not just how to fix the application, but what would make it more intuitive for your users. Could the navigation be in a better place or the contact information easier to find? Are there design components that could be more appealing and is the site accessible to a broad range of users? Is there a to make searching for specific products easier such as different a filter? Usability testing will assure your website remains a popular destination.
  7. How functional are different elements? It takes a testers eye to look beyond just the surface of the website to assess whether it really works the way it’s supposed to. Test search algorithms and results. Experiment with different filter combinations. Check calculations and confirm results. Any time a user has to input information or interact with the website, you should be testing whether or not that the application is responding correctly.
  8. What happens after a customer has completed their purchase? You’ve made it through and impressed (or avoided-annoying) a customer long enough. But you also want to make sure their experience is excellent from beginning to end so that they come back next time. Make sure that the page redirects to something thoughtful so that the customer understands their order is being processed. Give them options to review and cancel their order, contact customer support, and access tracking information. Each of these components needs to be tested to make sure that data is accurate and the functions work.

30 Days of E-Commerce Testing -Day 1-Look up some definitions for ‘ecommerce’, from these create and share your own definition.

 
Electronic commerce, commonly known as e-commerce or eCommerce, consists of the buying and selling of products or services over electronic systems such as the Internet and other computer networks.
Simply put, E-commerce is people or companies are engaged in commercial activities through the Internet.

What to do to make sure HTML Table is loaded completely if implicit and explicit wait are not working.

These days I was working on a project, to implement the delete function of a listing. Such as below: Actually,  every time deleted the it...