Difference between revisions of "Testing"

From LemonWiki共筆
Jump to navigation Jump to search
Line 40: Line 40:
* Double [[Testing#check_the_server.2Fservice_logs | check the server/service logs]]
* Double [[Testing#check_the_server.2Fservice_logs | check the server/service logs]]
=== (3)  from WAN to server ===
=== Connecting from WAN to the server ===
<span style="color:red">WAN &#9679; -------&gt; &#9679; LAN -------&gt; &#9679; server</span>
<span style="color:red">WAN &#9679; -------&gt; &#9679; LAN -------&gt; &#9679; server</span>

Revision as of 12:46, 2 October 2021

Test connectivity to the web service

find the problem occurred: (1) local service at the server (localhost) (2) from LAN to server (3) from WAN to server

Local service

WAN ○ -------> ○ LAN -------> ● server

Testing on localhost if you have the administrative permission to manage the server.

  • Check if your computer/server Is being assigned the IP Address.
    • Linux Os linux.png : (1) Check the IP Address. ifconfig. (2) Re-assign the IP Address and restart the networking service. service network restart for CentOS[1]
    • Win Os windows.png : Check the IP Address. ifconfig/all
    • More on Network problem
  • Is service alive? Is the port occupied by other process?
    • Linux Os linux.png
      • nmap "Network exploration tool and security / port scanner." e.g. nmap -p 80,443 ip
      • ss "utility to investigate sockets" e.g. ss -tnlp | grep 80 or using OR operator[2] ss -tnlp | grep '80\|443'
      • ps List the current processes. Input ps -aux | grep "PORT_NUMBER" e.g. ps -aux | grep 443
    • Win Os windows.png Using the software CurrPorts to check the process and port. e.g. Apache will not running if the 80 port was occupied by skype[3].
  • Is the port opened for external users? OS firewall or protected by antivirus software.
    • Linux Os linux.png
      • iptables: (1) iptables -L to list all rules[4] (2) rule with smaller line-number will override the rule with larger line-number[5]
      • FirewallD rules: (1) sudo firewall-cmd --get-default-zone return 'public' (2) sudo firewall-cmd --list-all --zone=public[6] (3) Allow port with FirewallD
      • SELinux Policy Management: (1) After installed policycoreutils-python[7], input semanage port -l to list open ports. (2) Allow port with semanage.
    • Win Os windows.png Windows Firewall with Advanced Security -> configure firewall rules
    • protected by antivirus software?
  • connect to localhost ex: telnet 23 where 23 is the port number where the service running
    • Install Telnet Client on Win Os windows.png
    • if the local service is web server, you can also try lynx for Linux Os linux.png
  • double check the server/service logs

From LAN to server

WAN ○ -------> ● LAN -------> ● server

Testing on LAN (local network, subnet scope): The different servers between LAN or with the same ip class (ex: 1.2.3.*) may not have the firewall limit.

  • Is the service alive?
  • Connect to the internal IP eg: telnet 23 (1) IP start with 172.18... is Private IP Network Numbers (2) where 23 is the port number where the service running
  • If the local service is web server, you can also try to connect the internal IP e.g. lynx for Linux Os linux.png
  • Double check the server/service logs

Connecting from WAN to the server

WAN ● -------> ● LAN -------> ● server

We met the trouble on WAN (wide area network). If we do no have the administrative permission, the tests we can do as follows:

other issue:

connection test

case 1: Access the server from outside network ex: WAN

Where are you? Access the server from outside network ex: Wide Area Network (WAN) or Local Area Network (LAN)

Open the browser from outside network ex: Wide Area Network (WAN) or Local Area Network (LAN)

  • and type the address: http://the.domain Icon_exclaim.gif Note: Not Private network / Private IP address
  • or use the remote website monitoring services: Web Ping

Using alternative web services if the Python was installed

  • (for python 2.x) python -m SimpleHTTPServer <port>[9]
  • (for python 3.x) python -m http.server <port>[10]

Using telnet client


  • curl -v -o /dev/null http://IP:Port If failed. It will show the message: "failed: Connection refused"


  1. Check server: Check host - online website monitoring, Check IP "checks the possibility of a TCP connection to host's specified port from different locations around the world." quoted from website. [Last visited: 2015-08-02]

case 2: Access the server from inside ex: localhost or Local LAN

If you has permission to log in the server via SSH or Remote desktop service.

  • (1)open the browser, (2)type the address:
  • Open Port Check Tool: Using browser to check the specified port of local machine from canyouseeme.org. Icon_exclaim.gif it may returned wrong result if the server hosted with shared external IP
  • Linux command:
    1. (optional if lynx was not installed) yum install lynx for CentOS / sudo apt-get install lynx for Ubuntu[11]
    2. lynx [12] for Linux Os linux.png


  1. telnet 80
  2. (after telnet-ed the web 80 port, key in) get + SPACE
  3. more on HTTP Check Port 80 with the Telnet Command

netstat ex: find MySQL 3306 port

  1. netstat -a | find "3306" (note: require the double quote symbol, not single quote symbol) for Win Os windows.png [13] or netstat -npl | grep 3306[14] for Linux Os linux.png
  2. more on List open ports and listening services


  1. Good.gif CurrPorts: Monitoring TCP/IP network connections on Windows
  2. PFPortCheck Program: check TCP/UDP port from localhost(where you installed the program) to portforward.com
  3. TCPView for Windows

user client node

browser & device issue

Online IDE

Programming online (Online IDE)

browser plug-ins issue

e-mail testing issue

Email testing

monitoring the status or changes of files or registry

monitoring or generating the HTTP request sent to the server

HTTP request and response data tool

domain name issue

Modify the following files if you want to test the domain name before the mapping of domain name and ip was changed really

  • C:\WINDOWS\system32\drivers\etc\hosts for Win Os windows.png XP, Win7[15], Win 10 & Windows Server 2008 R2 Standard
  • On Windows 2003 server: edit the file located at C:\WINNT\system32\drivers\etc\hosts
  • On Linux Os linux.png , input the command sudo vi /etc/hosts       localhost
# ip            domain.com
  • On Mac icon_os_mac.png , input the command sudo vi /private/etc/hosts [16]

Clear the DNS cache

more on DNS checking

handling form data

before submit the form data

  • (1)Use the Web Developer plugin for Firefox browser_firefox.png and (2)Menu -> Forms -> Display form details

after submit the form data

login issues into different accounts

If you need to clear the cookie frequently for the testing account issue

  • Using the privacy browsing for Firefox browser_firefox.png & Chrome Browser chrome.png . Each time you turning on the privacy browsing, the logged status and cookie will not saved.[17]
  • Manually clear cookie and temporary files of browser

file upload

excel format compatibility

Using Microsoft Excel Viewer to check the excel format compatibility. Icon_exclaim.gif It's not save to check the excel file only by using the old version of Excel.

database issue

  • SQL
    • SQL Fiddle support MySQL, MS SQL, Oracle, PosgreSQL, SQLite ... Good.gif

server environment

Testing server environment

local server node (if you has permission to log in the server via SSH or Remote desktop service)

check the server/service logs


Microsoft Windows

Web server


Apache HTTP server log: /etc/httpd/logs (location was set up in the configuration file /etc/httpd/conf/httpd.conf)

  • access.log
  • error.log - record when the apache service restarted/stopped

Using grep command to search the logs: grep -ir "string to search" /path/to/directory. More on Search text in files


Microsoft Internet Information Services (IIS) log (記錄檔)[18]

  • C:\WINDOWS\system32\LogFiles\

Database server


MySQL Server Logs:

  • step1: verify the system variable[19]
mysql> SHOW VARIABLES LIKE '%general_log%';
mysql> SHOW GLOBAL VARIABLES LIKE '%general_log%';
  • step2: enable logging /var/log/mysql.log (location was set up in the configuration file /etc/my.cnf or my.ini) [20]
## includes all SQL queries/commands
# general_log = 1
# general_log_file="general_log_file.log"
log-slow-queries = /var/log/mysql/mysql-slow.log
#another syntax
#slow_query_log_file = mysql-slow.log
long_query_time = 1
  • step3: restart MySQL service

Microsoft SQL Server





System.out.println("Boston, We Have A Problem" + variable); //output to Tomcat consile
out.println("Boston, We Have A Problem" + variable); //output to JSP webpage

or using NetBeans IDE - Debugger and Profiler to setup the breakpoints.

console command

//write the console output to the file
command > log.txt

//append to the same file
command >> log.txt

find match string

Owl icon.jpg If the message text or code snippets was not found in the plain text files, it may stored in the database.

related topic

related terms

  • functional testing



further reading

Web site design and development process