Filed under Mobile Apps Testing, Test Automation.

Why would I want to investigate the traffic that is made from a native iOS application ?

There are several reasons for which you would like to be able to see which are the requests a native application is making to the server side:
– to debug an issue that is happening in the application when you don’t have access to the server logs
– to check how the application is built in terms of the APIs that they are calling
– to check the security of an application
– to retry and make the same requests manually or automatically from an automation framework
– more details on how to debug native and HTML5 apps

How can I debug the traffic coming from a native application ?

The answer is very simple. All you need for being able to inspect the traffic is:
– have access to a WiFi network where both a laptop and the device that has the application are connected
– install an application called “Charles Web Debugging Proxy

How to configure the iPhone device so that the traffic appears in Charles ?

There are a few steps that you need to do to get to the point where you can see the traffic in Charles.
1. First find the IP address of the laptop where you installed Charles. You can find that pretty easily by using the
following commands from the terminal:

<strong>"ifconfig" for Linux/MacOS</strong>
<strong>"ipconfig" for Windows</strong>

2. Go to the iPhone device to Settings -> Wi-Fi. Click on the blue disclosure arrow to configure the network.

3. Scroll down until you get to the HTTP Proxy session. In there enter the IP of the laptop in the Server section, port 8888 in the Port section and leave Authentication Off.
4. Now open an application from you iPhone, for example Instagram.
5. You should see a prompt in Charles when you first make a connection from the iPhone, asking you to allow the traffic.


6. Now you will be able to see the traffic that is coming from your iPhone in Charles.


7. Remember to disable the HTTP Proxy in your Settings when you stop using Charles, otherwise you’ll get random network failures in your applications!

How can I see what is sent in the request that are made over https ?

For being able to see the content of the requests made over Https you need to follow the below steps:
1. On your iPhone, after you have set up Charles as proxy, open Safari and browse to http://www.charlesproxy.com/getssl. Safari will prompt you to install the SSL certificate.

3. Now you should be able to access SSL websites with Charles using SSL Proxying.
4. Go into Charles at Proxy -> SSL Proxying Settings and add the host of the call that you want to see the content for.
In our case the host is i.instagram.com and the port is 443.

5. Now go back to the iPhone and open the application again, in our case Instagram.

Now the traffic that is coming from the application will be shown as decrypted in Charles.

Hope this will help you debug your native applications more easily.

Filed under Apache JMeter, Load Testing, Performance Testing, Selenium WebDriver, UI Testing.

Here is how to use Apache JMeter’s WebDriver Sampler to load test the UI of the application, and by the UI, I mean load test a user’s workflow, with entering the web pages, clicking on different links etc.
All you have to do is install the JMeter plugins and make use of the WebDriver Config and WebDriver Sampler plugins which will offer this capability.
Let’s go into more detail and see how to load test an app with Apache JMeter’s WebDriver Sampler.
Here are the steps to Load Test the UI:
  • Add a Chrome Driver Config

      • choose if you want to create a new Browser at the start of each iteration (if you don’t tick this option, the browser instances are going to be reused per each thread, which will cache some of the assets, requests)

  • Add a WebDriver Sampler

      • add the following code which will monitor the load time for loading the following webpage https://www.example.com?uid=${token}

 	WDS.sampleResult.sampleStart()
 	WDS.browser.get('https://www.example.com?uid=${token}')
 	WDS.sampleResult.sampleEnd()
      • the token variable is previously generate by an HTTP POST request
      • imagine the scenario where you first have to authenticate in order to access a webpage, this is what we do
          • generate a token with an HTTP POST request
          • extract the token from the HTTP POST response
        • open the webpage with the token as a query parameter and monitor the load time
    • add an Aggregate Report in order to measure the load testing metrics like number of samples, response times, errors, throughput
    • add the Listeners from the JMeter Plugins: Response Times Over Time, Hits per Second and Active Threads Over Time to better understand the behaviour of your application while running the load test of the UI

Run the test at the beginning with only 1 thread in parallel, to create the baseline. The you can increase the number of threads (parallel users) to find performance bottlenecks. Here are more details on performance testing vs load testing.

Hope this helps.

Filed under Apache JMeter, Test Automation.

Here are details on how to save or export the results of your Apache JMeter test script to a CSV or XML file.

Setup

1. Open Apache JMeter (here is how to start Apache JMeter on Mac) and right click Test Plan and Add -> Threads (Users) -> Thread Group
2. Right click Thread Group and Add -> Samplers -> HTTP Request
3. Add example.com to the Server input field of the HTTP Request
4. Right click Thread Group and Add -> Listeners -> Aggregate Report

More details on how to load test a web server with Apache JMeter.

Save Apache JMeter Results to a CSV file

1. Configure the filename in the Filename field of the Aggregate Report
i.e.: [FULLPATH]/results.csv
where [FULLPATH] is the path on the disk to the directory where you want to save the Apache JMeter results.
2. Run the test script
Result
A file with the results.csv name should now be created at the path specified.

Save Apache JMeter Results to a XML file

1. Go in the Aggregate Report and click the Configure button
2. Check the Save as XML field in the top left corner.
3. Change the extension of the filename to XML i.e. [FULLPATH]/results.xml

Result
A file with the results.xml name should now be created at the path specified.

 

Save results to current test script location

If you want to use the current test script location as the destination of your Apache JMeter test scripts, you can follow the below steps:


Apache JMeter note:
Don’t use GUI mode for load testing, only for Test creation and Test debugging!
For load testing, use NON GUI Mode & adapt Java Heap to your test requirements

Filed under Test Automation.

We’ve speed tested over 30000 websites and here are the speed test results after running the website speed tests:

Total: 30000 websites tested – Check how fast is your website for free

Response times between 0ms – 200ms
223 (<1%) websites with response time between 0ms – 200ms

Response times between 200ms – 500ms
641 (~2%) websites with response time between 200ms – 500ms

 

Response times between 500ms – 750ms
708 (~2%) websites with response time between 500ms – 750ms

 

Response times between 750ms – 1000ms
718 (~2%) websites with response time between 750ms – 1000ms

 

Response times between 1000ms – 2000ms
3794 (~16%) websites with response time between 1000ms – 2000ms

 

Response times between 2000ms – 3000ms
3521 (~11%) websites with response time between 2000ms – 3000ms

 

Response times between 3000ms – 5000ms
4961 (~16%) websites with response time between 3000ms – 5000ms

 

Response times between 5000ms – 10000ms
5641 (~19%) websites with response time between 5000ms – 10000ms

 

Response times between: greater than 10000ms
9793 (~32%) websites with response time between 10000ms

 

 

Only 7% of the websites tested have a response time lower than 1 second.

Also more than 50% of the websites tested, almost 15k websites, have a response time greater than 5 seconds.

A higher response time translates indirectly in potential customers leaving your website.
How to Improve Your Page Load Speed by 50% in less than 30 Minutes? Here are a few hints which can make a huge difference:
  • minify assets (JS files, CSS files)
  • minify HTML
  • use CSS Image Sprites
  • optimise images
  • use CDN for hosting images and other assets (fonts etc) – inspect latency
  • move JS files at the bottom of your HTML page and CSS files at the top
  • group multiple CSS files and JS files into a single (minified) CSS or JS file if possible
  • eliminate Render-Blocking JavaScript and CSS (Async Javascript)
  • rely on browser caching
  • remove unused widgets, plugins
  • improve server side hardware (DB queries, hardware, etc)
  • more details on increasing rendering speed
As you saw above, there are loads of things you can do to improve your website rendering speed. We also offer a free website speed test.
To get a better understanding and speed insights related to your website, create an account today with LoadFocus and run a full website speed test.

Filed under Selenium WebDriver, Test Automation, UI Testing.

If you want to open a new tab in the browser with Selenium WebDriver and Java, below we’ve listed some working examples. Have in mind that at the moment, Selenium WebDriver has no build-in ability to open new tabs or new windows, and because of this we have to force the browser to open the links in new tabs or in new windows. This may be implemented in a later version of Selenium WebDriver.

1. Open an existent link a a new tab using Selenium WebDriver and Actions

More details on how to locate web elements with Selenium WebDriver.

//identify the link in the page, that you want to open in a new tab of your browser's instance
WebElement link = driver.findElement(By.cssSelector(linkLocator));

//this action will click the WebElement with the link identified above, hold CONTROL Key (or COMMAND if you're using Mac), click the WebElement and relese the Keys.CONTROL (use Keys.COMMAND if you're using Mac).
new Actions(driver)
.keyDown(Keys.COMMAND)
.click(link)
.keyUp(Keys.COMMAND)
.build()
.perform();

The code above works in all browsers.

2. Open an existent link a a new tab using Selenium WebDriver with CONTROL/COMMAND Key and T

There is also another option that may not work in Chrome browsers at the moment because of a limitation in the way keyboard inputs are simulated in ChromeDriver. Keys are sent directly to the render process, so any keyboard shortcut in the browser process will not be invoked by sendKeys() method.

String selectLinkOpeninNewTab = Keys.chord(Keys.CONTROL,"t");

Keys chord(CharSequence… value) method – Simulates pressing many keys at once in a “chord”. Takes a sequence of Keys.XXXX or strings; appends each of the values to a string, and adds the chord termination key (Keys.NULL) and returns the resultant string. Note: When the low-level webdriver key handlers see Keys.NULL, active modifier keys (CTRL/ALT/SHIFT/etc) release via a keyup event.

The code below will open the link in new Tab.

 

driver.findElement(By.cssSelector("body")).sendKeys(selectLinkOpeninNewTab);

Then when you open a new tab in your browser, you have to switch to it to be able to work with the newly opened tab’s elements:

How fast is your website comparing to your competitor’s? Check now!

Filed under Load Testing, Performance Testing, Test Automation.

If you ever asked yourself “What is the difference between Performance Testing and Load Testing”, below are listed some of the main characteristics of Performance Testing and Load Testing, and how are they different from one another.

What is Performance Testing?

Performance Testing represents the characteristics of a system, how fast is that system, in general it refers to the tests undertaken to determine how that system behaves and performs.

Prerequisites for Performance Testing

We need to have clearly defined goals before starting any performance tests. The goals defined will help us if after getting the performance tests results there is a need for system improvement.

Performance Testing Results

After running performance tests, you need to inspect the metrics like response and latency times, hits per second, throughput per second, errors (client side metrics) and CPU, Memory, I/O (server side metrics) for the system tested.

Performance Testing Goals

Set a base line for the system under test for future releases and potential improvement of the system. It helps to identify potential bottlenecks, that can be found at different levels: system level (client and server side), DB level, network level.

LoadFocus.com is a All-In-One Cloud Testing Platform for Load Testing and Performance Testing, Website Speed Testing, Automated Website Testing and Mobile Emulation for Websites, Mobile Applications and API Endpoints.

Filed under Selenium WebDriver, Test Automation.

We’ve created an Online Courses platform for each one of you who wants to learn something new in 2017. We’ve added video courses which will help you go from no testing knowledge to becoming a proficient automated tester, with loads of knowledge regarding setting up automation framework, to creating good UI functional tests and structuring your projects in a maintainable way.

Here are the steps that we recommend, in order to go from novice to a professional automation tester:

 

The Ultimate Selenium WebDriver Testing & Hands-on Guide (£100)Selenium WebDriver training

 

Ultimate Selenium WebDriver Testing & Hands-on Guide is a step-by-step interactive session that will handhold you all the way to understand software architecture, what should / should not be tested and where you should start.

 

 

Video Course on How to Select a Dropdown in Selenium WebDriverdropdown element online course

(£10)

Highlights all possibilities available to interact with a dropdown element with Selenium WebDriver, and it covers just the right amount of dropdown interaction details which are needed for automation.

 

 

 

Best Ways on How to Find XPath for Web Elements in Chrome andxpath online course

Firefox Browsers (£15)

 

XPath Online Course is a comprehensive, yet simple course and it concentrates on identifying XPath for web elements in an very effective way.

 

 

 

How To Write Faster Selenium WebDriver Tests (£10)faster webdriver tests online course

How To Write Faster Selenium WebDriver Tests video course concentrates on best practices for identifying ways to improve your automated tests.

 

 

Jenkins CI Installation and Deployment on Mac and Ubuntujenkins online course

(hands-on video course) (£28)

 

Create, configure your first Jenkins job, and run it (debugging results and console logs are also provided)

 

 

 

Learn JMETER from Scratch for Performance Testing andjmeter online course

Load Testing (Hands-On Guide) (£48)

 

Apache JMeter Load Testing Online Course is a hands-on, yet simple course and it concentrates on identifying starting to use Apache JMeter to load test any website or web service.

 

 

With the above online video courses you’ll get enough knowledge to start your journey into becoming a better tester, more efficient and with loads of hands-on knowledge.

The online video courses are provided by LoadFocus Courses platform.