From LemonWiki共筆
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Test connectivity to the web service[edit]

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

Connecting from the local server to local service[edit]

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
      • netstat Command netstat -tulpn | grep LISTEN e.g.
    • 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].
$ netstat -tulpn | grep LISTEN

tcp        0      0    *               LISTEN      - 

// means the 80 port service is running
  • 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

Connecting from LAN to the server[edit]

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[edit]

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[edit]

Case 1: Access the server from outside network ex: WAN[edit]

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[edit]

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[edit]

browser & device issue[edit]

Online IDE[edit]

Programming online (Online IDE)

browser plug-ins issue[edit]

e-mail testing issue[edit]

Email testing

monitoring the status or changes of files or registry[edit]

monitoring or generating the HTTP request sent to the server[edit]

HTTP request and response data tool

domain name issue[edit]

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[edit]

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[edit]

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[edit]

excel format compatibility[edit]

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[edit]

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

server environment[edit]

Testing server environment

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

check the server/service logs


Microsoft Windows[edit]

Web server[edit]


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[edit]


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[edit]





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[edit]

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

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

find match string[edit]

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[edit]

related terms

  • functional testing



further reading

Web site design and development process