Testing: Difference between revisions

From LemonWiki共筆
Jump to navigation Jump to search
Line 16: Line 16:
** connect to localhost ex: {{kbd | key= telnet 127.0.0.1 23}} where 23 is the port number where the service running
** connect to localhost ex: {{kbd | key= telnet 127.0.0.1 23}} where 23 is the port number where the service running
*** if the local service is web server, you can also try  {{kbd | key = <nowiki>lynx http://127.0.0.1</nowiki>}} for {{Linux}}
*** if the local service is web server, you can also try  {{kbd | key = <nowiki>lynx http://127.0.0.1</nowiki>}} for {{Linux}}
* double [[Testing#check_the_server.2Fservice_logs | check the server/service logs]]


WAN o ------- <span style="color:red">o LAN ------- o localhost</span>
WAN o ------- <span style="color:red">o LAN ------- o localhost</span>

Revision as of 20:03, 16 December 2015

Web site design and development process


troubleshooting steps for connection test

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

WAN o ------- o LAN ------- o localhost

  • testing on localhost:
    • Is service alive?
    • OS firewall ex: server with iptable limit for Linux Os linux.png ? Firewall option for Win Os windows.png ?
      • Linux Os linux.png
        • (1) iptables -L to list all rules[1] (2) rule with lower line-number will override the rule with higherer line-number[2]
        • FirewallD rules ex: firewall-cmd --list-all-zones[3]
        • SELinux Policy Management ex: semanage port -l to list open ports
    • protected by antivirus?
    • connect to localhost ex: telnet 127.0.0.1 23 where 23 is the port number where the service running
      • if the local service is web server, you can also try lynx http://127.0.0.1 for Linux Os linux.png
  • double check the server/service logs

WAN o ------- o LAN ------- o localhost

  • testing on LAN: Is service alive? The different servers between LAN or with the same ip class (ex: 1.2.3.*) may not have the firewall limit.
    • connect to localhost ex: telnet 172.18.0.1 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 lynx http://172.18.0.1 for Linux Os linux.png
  • double check the server/service logs

WAN o ------- o LAN ------- o localhost

We met the trouble on WAN

  • testing on WAN: Down for everyone or just me? Check by Web Ping
  • is gateway alive?
  • is DND alive?

other issue:

  • bandwidth cost too much by certain users
  • exceed the request limit of (hardware) firewall
  • the external connection of updated Windows was down until reboot Win Os windows.png
  • Amazon EC2 security group

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

telnet

  • telnet DOMAIN_or_IP PORT ex: telnet the.domain 80
    • If connected. The console windows will show the message "Escape character is '^]'. " for Linux Os linux.png . Or show a blank window for Win Os windows.png If you want to end the telnet command. You can (1) press Ctrl + ] and (2) keyin quit to end the telnet.
    • If failed. It will show the message: "telnet: Unable to connect to remote host: Connection refused"

tools

  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: http://127.0.0.1
  • 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[4]
    2. lynx http://127.0.0.1 [5] for Linux Os linux.png

telnet

  1. telnet 127.0.0.1 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 [6] or netstat -npl | grep 3306[7] for Linux Os linux.png
  2. more on List open ports and listening services

tools

  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 issue

online IDE

browser plug-ins issue

e-mail testing issue

Using the following e-mail service with name alias or alternative name function

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[9]
  • C:\WINNT\system32\drivers\etc\hosts for Windows 2003 server
  • /etc/hosts for Linux Os linux.png
127.0.0.1       localhost
# ip            domain.com


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.[10]
  • 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

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

check the server/service logs

OS

Microsoft Windows

Web server

Apache

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

IIS

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

  • C:\WINDOWS\system32\LogFiles\

Database server

MySQL

MySQL Server Logs:

  • step1: enable logging /var/log/mysql.log (location was set up in the configuration file /etc/my.cnf or my.ini) [12]
[mysqld] 
## includes all SQL queries/commands
# general_log = 1
# general_log_file="general_log_file.log"
log-error=/var/log/mysql/error.log
log-slow-queries = /var/log/mysql/mysql-slow.log
#another syntax
#slow_query_log_file = mysql-slow.log
long_query_time = 1
log-long-format
  • step2: restart MySQL service


Microsoft SQL Server

Other

PHP

PHP_errors#logging

Java

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.

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

references