Testing: Difference between revisions

From LemonWiki共筆
Jump to navigation Jump to search
mNo edit summary
 
(112 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Template:Build a website}}
== 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: {{kbd | key =<nowiki>http://the.domain</nowiki>}} {{exclaim}} Note: Not [https://en.wikipedia.org/wiki/Private_network Private network] / Private IP address
* or use the remote website monitoring services: [[Web Ping]]


telnet
== Test connectivity for the web service ==
* telnet ''DOMAIN_or_IP'' ''PORT'' ex: {{kbd | key = telnet the.domain 80}}
[[Test connectivity for the web service]]
** If connected. The console windows will show the message "Escape character is '^]'. " for {{Linux}}. Or show a blank window for {{Win}} If you want to end the telnet command. You can (1) press {{Kbd plus | key1 = Ctrl | key2 = ]}} and (2) keyin {{Kbd | key = quit}} to end the telnet.
** If failed. It will show the message: "telnet: Unable to connect to remote host: Connection refused"
 
=== 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: {{kbd | key = <nowiki>http://127.0.0.1</nowiki> }}
* [http://www.canyouseeme.org/ Open Port Check Tool]: ''Using browser'' to check the specified port of local machine from canyouseeme.org. {{exclaim}} it will make a mistake if the server hosted with shared external IP
* Linux command:
*# (optional if lynx was not installed) {{kbd | key = <nowiki>yum install lynx</nowiki>}} for CentOS / {{kbd | key = <nowiki>sudo apt-get install lynx</nowiki>}} for Ubuntu<ref>[http://www.addictivetips.com/ubuntu-linux-tips/install-and-use-lynx-on-ubuntu/ Install and Use Lynx Browser on Ubuntu]</ref>
*# {{kbd | key = <nowiki>lynx http://127.0.0.1</nowiki>}} <ref>[http://lynx.isc.org/lynx2.8.7/lynx2-8-7/lynx_help/Lynx_users_guide.html Lynx Users Guide v2.8.7]</ref> for {{Linux}}
 
telnet
# {{kbd | key = telnet 127.0.0.1 80}}
# (after telnet-ed the web 80 port, key in) {{kbd_plus | key1 = get | key2 = SPACE}}
# more on [http://www.simplescripts.de/http-check-port-80-telnet-command.htm HTTP Check Port 80 with the Telnet Command]
 
netstat ex: find MySQL 3306 port
# {{kbd | key = <nowiki>netstat -a | find "3306"</nowiki>}} (note: require the '''double quote''' symbol, not single quote symbol) for {{Win}}<ref>[http://technet.microsoft.com/en-us/library/bb490947.aspx Netstat]</ref> or {{kbd | key = <nowiki>netstat -npl | grep 3306</nowiki>}}<ref>[http://www.cyberciti.biz/faq/find-out-which-service-listening-specific-port/ Linux / UNIX Find Out What Program / Service is Listening on a Specific TCP Port]</ref> for {{Linux}}
# more on [http://www.techrepublic.com/blog/security/list-open-ports-and-listening-services/443 List open ports and listening services]
 
tools
# {{Gd}} [http://www.nirsoft.net/utils/cports.html CurrPorts: Monitoring TCP/IP network connections on Windows]
# [http://portforward.com/help/portcheck.htm PFPortCheck Program]: check TCP/UDP port from localhost(where you installed the program) to portforward.com
# [http://technet.microsoft.com/en-us/sysinternals/bb897437 TCPView for Windows]
 
=== troubleshooting steps ===
We met the trouble on WAN
* testing on WAN: Down for everyone or just me? Check by [[Web_Ping#同時從世界各處測試網站連線 | Web Ping]]
* testing on localhost:
** Is service alive?
** OS firewall ex: server with iptable limit for {{Linux}}? Firewall option for {{Win}}?
*** {{Linux}} (1) {{kbd | key = iptables -L  --line-numbers}} to list all rules<ref>[http://wiki.centos.org/HowTos/Network/IPTables HowTos/Network/IPTables - CentOS Wiki]</ref> (2) rule with lower line-number will override the rule with higherer line-number<ref>[https://fedoraproject.org/wiki/How_to_edit_iptables_rules?rd=User_talk:Rforlot How to edit iptables rules - FedoraProject]</ref>
** protected by antivirus?
* testing on LAN: Is service alive? The servers between LAN or with the same ip class (ex: 1.2.3.*) often without firewall limit.
** double [[Testing#check_the_server.2Fservice_logs | check the server/service logs]]
* find the problem occurred: (1)local service (2)server to LAN (3)server to WAN
* other issue:
** bandwidth cost too much by certain users,
** exceed the request limit of firewall
** the external connection of updated Windows was down until reboot {{Win}}
** Amazon EC2 security group


== user client node ==
== user client node ==


=== browser issue ===
=== browser & device issue ===
* browser version: [[Check Browser Compatibility]] & Validation service or [[Validator]]: Check Markup or CSS syntax
* Browser version: [[Check Browser Compatibility]] & Validation service or [[Validator]]: Check Markup or CSS syntax
* clear browser cache
* Multiple screen resolution test: [[CSS_tools#不同螢幕解析度檢視網頁 | 不同螢幕解析度檢視網頁]]
** client temporary files
* [[Mobile friendliness tool]]
** clear server cache ex: [http://www.smarty.net/manual/en/caching.php Smarty Caching]
* Disable all extensions
* Clear browser cache by [http://en.wikipedia.org/wiki/Wikipedia:Bypass_your_cache Bypass your cache] ([http://zh.wikipedia.org/wiki/Help:%E7%BB%95%E8%BF%87%E6%B5%8F%E8%A7%88%E5%99%A8%E7%BC%93%E5%AD%98 繞過瀏覽器快取])
** Client temporary files
** [https://www.technipages.com/google-chrome-how-to-completely-disable-cache Google Chrome: How to Disable Cache]
* Clear server cache ex: [http://www.smarty.net/manual/en/caching.php Smarty Caching]


==== online IDE ====
==== Online IDE ====
* code snippet web-based editor  / communication tools between developers/designers
[[Programming online (Online IDE)]]
** [http://codepad.org/ codepad] {{access | date=2012-10-02}} {{access | date = 2014-10-07}}
** [http://cssdesk.com/ CSSDesk] HTML, CSS {{access | date=2013-02-11}}
** [http://dabblet.com/ The first commented line is your dabblet’s title ✿ dabblet.com]: view the [http://dabblet.com/gist/2779082 sample] of html and css {{access | date = 2012-08-22}}
** [http://ideone.com/ Ideone.com] "Online IDE & Debugging Tool >> C/C++, Java, PHP, Python, Perl and 40+ compilers and interpreters"
** [http://jsbin.com/ JS Bin - Collaborative JavaScript Debugging]: HTML, CSS, Javascript<ref>[http://blog.miniasp.com/post/2013/06/30/Useful-tool-JS-Bin-Collaborative-JavaScript-Debugging.aspx The Will Will Web - 介紹好用工具:JS Bin ( 網站前端工程師的學習利器 )]</ref>
** [http://jsfiddle.net/ jsFiddle] {{access | date = 2014-10-07}}
** [http://plnkr.co/ Plunker] {{access | date = 2014-10-07}}
* database testing
** [http://ideone.com/ Ideone.com] support SQL
** [http://sqlfiddle.com/ SQL fiddle] support MySQL, MS SQL server, Oracle, PostgreSQL, SQLite ...  {{exclaim}} data will be cleaned after couple days {{access | date = 2015-03-05}}


* Save or share source codes
=== browser plug-ins issue ===
** [http://pastie.org/ Pastie] with syntax highlighting
** [http://pastebin.com/ Pastebin.com - #1 paste tool since 2002!]
** [http://tny.cz/ Tinypaste - The easiest way to host your text]
 
=== plug-ins issue ===
* [http://www.adobe.com/software/flash/about/ Test your Adobe Flash Player installation]
* [http://www.adobe.com/software/flash/about/ Test your Adobe Flash Player installation]
* [http://www.adobe.com/shockwave/welcome/ Adobe - Test Adobe Shockwave Player]
* [http://www.adobe.com/shockwave/welcome/ Adobe - Test Adobe Shockwave Player]
Line 86: Line 24:


=== e-mail testing issue ===
=== e-mail testing issue ===
Using the following e-mail service with name alias or alternative name function
[[Email testing]]
* [https://gmail.google.com/ Google Gmail]: plus sign {{exclaim}} the plus sign is not allowed by some services
* [http://get.live.com/mail/overview Windows Live™ Hotmail]: [http://windows.microsoft.com/zh-TW/hotmail/conquergraymail/advanced/alias Alias] / 在一個收件匣建立多個別名 {{access | date=2012-03-30}}


=== monitoring the status or changes of files or registry ===
=== monitoring the status or changes of files or registry ===
Line 99: Line 35:
=== domain name issue ===
=== 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
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}} XP, Win7<ref>[http://tommy.ironman.tw/windows-7-vista-hosts-error/ Azan 黃贊臣 » 在Windows 7 或 Vista 中修改hosts檔的方法]</ref>
* C:\WINDOWS\system32\drivers\etc\hosts for {{win}} XP, Win7<ref>[http://tommy.ironman.tw/windows-7-vista-hosts-error/ Azan 黃贊臣 » 在Windows 7 或 Vista 中修改hosts檔的方法]</ref>, Win 10 & Windows Server 2008 R2 Standard
* C:\WINNT\system32\drivers\etc\hosts for Windows 2003 server
* On Windows 2003 server: edit the file located at {{kbd | key=<nowiki>C:\WINNT\system32\drivers\etc\hosts</nowiki>}}
* {{kbd | key=<nowiki>/etc/hosts</nowiki>}} for {{Linux}}
* On {{Linux}}, input the command {{kbd | key=<nowiki>sudo vi /etc/hosts</nowiki>}}
<pre>
<pre>
127.0.0.1      localhost
127.0.0.1      localhost
# ip            domain.com
# ip            domain.com
</pre>
</pre>
* On {{Mac}}, input the command {{kbd | key=<nowiki>sudo vi /private/etc/hosts</nowiki>}} <ref>[https://www.tekrevue.com/tip/edit-hosts-file-mac-os-x/ How to Edit the Hosts File on Mac OS X - TekRevue]</ref>


Clear the DNS cache
* [http://www.noip.com/support/knowledgebase/how-do-i-flush-my-windows-dns-cache/ How Do I Clear My DNS Cache on Windows? | Support | No-IP] for {{Win}}
* [https://support.apple.com/en-us/HT202516 Reset the DNS cache in OS X - Apple Support] for {{Mac}}


more on [[Web_Ping#DNS.E6.AA.A2.E6.9F.A5 | DNS checking]]
more on [[Web_Ping#DNS.E6.AA.A2.E6.9F.A5 | DNS checking]]
Line 134: Line 75:
* SQL
* SQL
** [http://sqlfiddle.com/ SQL Fiddle] support MySQL, MS SQL, Oracle, PosgreSQL, SQLite ... {{Gd}}
** [http://sqlfiddle.com/ SQL Fiddle] support MySQL, MS SQL, Oracle, PosgreSQL, SQLite ... {{Gd}}
== server environment ==
[[Testing server environment]]


== local server node (if you has permission to log in the server via SSH or Remote desktop service) ==
== local server node (if you has permission to log in the server via SSH or Remote desktop service) ==
Line 157: Line 101:
==== MySQL ====
==== MySQL ====
[http://dev.mysql.com/doc/refman/5.1/en/server-logs.html MySQL Server Logs]:  
[http://dev.mysql.com/doc/refman/5.1/en/server-logs.html MySQL Server Logs]:  
* step1: enable logging /var/log/mysql.log (location was set up in the configuration file /etc/my.cnf or my.ini) <ref>[http://blog.longwin.com.tw/2005/10/mysql_query_slow_find/ 找出 MySQL 哪些 Query 速度較慢 | Tsung's Blog]</ref>
* step1: verify the system variable<ref>[https://dev.mysql.com/doc/refman/5.7/en/show-variables.html MySQL :: MySQL 5.7 Reference Manual :: 13.7.5.39 SHOW VARIABLES Syntax]</ref>
<pre>
mysql> SHOW VARIABLES LIKE '%general_log%';
mysql> SHOW GLOBAL VARIABLES LIKE '%general_log%';
</pre>
* step2: enable logging /var/log/mysql.log (location was set up in the configuration file /etc/my.cnf or my.ini) <ref>[http://blog.longwin.com.tw/2005/10/mysql_query_slow_find/ 找出 MySQL 哪些 Query 速度較慢 | Tsung's Blog]</ref>
<pre>
<pre>
[mysqld]  
[mysqld]  
Line 171: Line 120:
</pre>
</pre>


* step2: restart MySQL service
* step3: restart MySQL service
 


==== Microsoft SQL Server ====
==== Microsoft SQL Server ====
Line 181: Line 129:
=== Other ===
=== Other ===
==== PHP ====
==== PHP ====
native error logging
[[PHP_errors#logging]]
* [http://www.php.net/ PHP] log: check the configuration file: /etc/php.ini (the location of configuration file can be verified by [http://php.net/manual/en/function.phpinfo.php phpinfo()] )
(for production site) unmark theese lines in the php.ini and restart Apache service
<pre>
log_errors = On
error_log = "php_error.log"
</pre>
(for development site) using [http://php.net/manual/en/function.error-reporting.php error_reporting]
<pre>
error_reporting(E_ALL);
</pre>


[http://tw1.php.net/print_r PHP: print_r - Manual]
==== Java ====
<pre>
$log = print_r($variable, true);
//save to the log file
 
$log = print_r(debug_backtrace(), true);
//Generates a backtrace and save to the log file
</pre>


capture the result of var_dump:
ob_start
* [http://stackoverflow.com/questions/139474/how-can-i-capture-the-result-of-var-dump-to-a-string php - How can I capture the result of var_dump to a string? - Stack Overflow]
* [http://php.net/manual/en/function.error-log.php PHP: error_log - Manual]
<pre>
<pre>
ob_start();
System.out.println("Boston, We Have A Problem" + variable); //output to Tomcat consile
var_dump($some_variable);
out.println("Boston, We Have A Problem" + variable); //output to JSP webpage
$result = ob_get_clean();
error_log($result, 3, 'd:/result.log');
</pre>
</pre>


QuickForm
or using [https://netbeans.org/features/java/debugger.html NetBeans IDE - Debugger and Profiler] to setup the breakpoints.
<pre>
$result = var_dump($some_variable);
$form->addElement('html', $result);
</pre>


 
==== console command ====
[http://ellislab.com/codeigniter CodeIgniter]: [http://stackoverflow.com/questions/7370391/how-to-configure-codeigniter-to-report-all-errors php - How to configure Codeigniter to report all errors? - Stack Overflow]
 
 
show the line number and filename
<pre>
<pre>
echo 'Houston, we've had a problem '. __line__ . ' ' . __FILE__ ."<br />";
//write the console output to the file
</pre>
command > log.txt
more on [http://php.net/manual/en/language.constants.predefined.php PHP: Magic constants]
 
==== Java ====


<pre>
//append to the same file
System.out.println("Boston, We Have A Problem" + variable); //output to Tomcat consile
command >> log.txt
out.println("Boston, We Have A Problem" + variable); //output to JSP webpage
</pre>
</pre>
or using [https://netbeans.org/features/java/debugger.html NetBeans IDE - Debugger and Profiler] to setup the breakpoints.


== find match string ==
== find match string ==
Line 253: Line 164:
* functional testing
* functional testing


== references ==
templates
* [[Bug report template]]
 
== References ==
<references/>
<references/>
further reading
* [http://help.trello.com/article/736-troubleshooting-browser-issues-with-trello Troubleshooting browser issues with Trello - Trello Help] {{access | date = 2017-03-28}}
* [https://asana.com/guide/help/faq/connectivity Supported browsers and troubleshooting steps for Asana | Product guide · Asana] {{access | date = 2017-03-28}}
* [https://ngrok.com/ ngrok - secure introspectable tunnels to localhost] {{access | date = 2020-02-20}}
{{Template:Build a website}}


[[Category:Software]]
[[Category:Software]]
Line 260: Line 182:
[[Category:Web_Dev]]
[[Category:Web_Dev]]
[[Category:MySQL]]
[[Category:MySQL]]
[[Category:Linux]]
[[Category:Testing]]

Latest revision as of 14:49, 14 August 2023

Test connectivity for the web service[edit]

Test connectivity for the web service

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[1], 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
127.0.0.1       localhost
# ip            domain.com
  • On Mac icon_os_mac.png , input the command sudo vi /private/etc/hosts [2]


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

OS[edit]

Microsoft Windows[edit]

Web server[edit]

Apache[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

IIS[edit]

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

  • C:\WINDOWS\system32\LogFiles\

Database server[edit]

MySQL[edit]

MySQL Server Logs:

  • step1: verify the system variable[5]
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) [6]
[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
  • step3: restart MySQL service

Microsoft SQL Server[edit]

Other[edit]

PHP[edit]

PHP_errors#logging

Java[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

templates

References[edit]

further reading


Web site design and development process