Introduction: 5 Minute Manual Website Test Script
Sometimes automatic tests/screenshots are not enough, especially if you pick up a project that hasn't been developed with TDD in mind at first place, therefore forcing you to choose between donating your free time to develop automatic tests or manually testing each page on every global change. For one timer, it might be better to choose second option, so here is a 5 min setup for such scenario.
Step 1: First, We Will Need a List of All Pages in the Site
with [FILTER] i mean for .NET sites *.aspx, for php *php; for both maybe *.htm or *.html too, depends on the pages' structure
If you are sitting at the dev server, navigate with your evelated cmd prompt to the website folder and write
dir [FILTER] /s/b >> c:\dirlist.txt
If you are sitting at the dev server, navigate with your evelated cmd prompt to the website folder and write
dir [FILTER] /s/b >> c:\dirlist.txt
Step 2: 2. Locate and Edit the File List
Open up your favorite file manager (mine is explorer.exe) and direct the file to notepad++.
Step 3: Create Frame for Launching Your Tests
Create a new file in notepad++;
Choose web browsers and locate their paths (might need to install them first?). I have choosen 5 of them:
Webkit: chrome & safari
Gecko: firefox
Trident: Iexplore (the secret version only i possess)
Mobile: Opera Mobile emulator that emulates Samsung Galaxy S
Then write a framework for test launching, for example like one i give here
[my first time here, so not sure whether IT will allow me to pass .bat file correctly, so will write a copy of its content below]
SET CURR_PROG="%ProgramFiles%\Internet Explorer\IEXPLORE.EXE"
SET CURR_PROG_A="%ProgramFiles%\Opera Mobile Emulator\OperaMobileEmu.exe" -displayzoom 100 -windowsize 480x800 -ppi 240 -user-agent-string Android -profile-name "Samsung Galaxy S"
SET CURR_PROG_B="%USERPROFILE%\Local Settings\Application Data\Google\Chrome\Application\chrome.exe" --new-window
SET CURR_PROG_C="%ProgramFiles%\Mozilla Firefox\firefox.exe"
SET CURR_PROG_D="%ProgramFiles%\Safari\Safari.exe"
SET CURR_MODULE=%2
SET CURR_SITE=%1
IF [%CURR_SITE%]==[after] SET CURR_ADDRESS=http://localhost:8118/
IF [%CURR_SITE%]==[before] SET CURR_ADDRESS=http://localhost:8228/
REM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IF [%CURR_ADDRESS%]==[] GOTO End
IF [%CURR_MODULE%]==[moduleone] GOTO ModuleOne
IF [%CURR_MODULE%]==[moduletwo] GOTO ModuleTwo
IF [%CURR_MODULE%]==[] GOTO ModuleOne;
ELSE GOTO End;
:ModuleOne
pause
IF [%CURR_MODULE%]==[] GOTO ModuleTwo;
ELSE GOTO End;
:ModuleTwo
GOTO End;
:End
Choose web browsers and locate their paths (might need to install them first?). I have choosen 5 of them:
Webkit: chrome & safari
Gecko: firefox
Trident: Iexplore (the secret version only i possess)
Mobile: Opera Mobile emulator that emulates Samsung Galaxy S
Then write a framework for test launching, for example like one i give here
[my first time here, so not sure whether IT will allow me to pass .bat file correctly, so will write a copy of its content below]
SET CURR_PROG="%ProgramFiles%\Internet Explorer\IEXPLORE.EXE"
SET CURR_PROG_A="%ProgramFiles%\Opera Mobile Emulator\OperaMobileEmu.exe" -displayzoom 100 -windowsize 480x800 -ppi 240 -user-agent-string Android -profile-name "Samsung Galaxy S"
SET CURR_PROG_B="%USERPROFILE%\Local Settings\Application Data\Google\Chrome\Application\chrome.exe" --new-window
SET CURR_PROG_C="%ProgramFiles%\Mozilla Firefox\firefox.exe"
SET CURR_PROG_D="%ProgramFiles%\Safari\Safari.exe"
SET CURR_MODULE=%2
SET CURR_SITE=%1
IF [%CURR_SITE%]==[after] SET CURR_ADDRESS=http://localhost:8118/
IF [%CURR_SITE%]==[before] SET CURR_ADDRESS=http://localhost:8228/
REM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IF [%CURR_ADDRESS%]==[] GOTO End
IF [%CURR_MODULE%]==[moduleone] GOTO ModuleOne
IF [%CURR_MODULE%]==[moduletwo] GOTO ModuleTwo
IF [%CURR_MODULE%]==[] GOTO ModuleOne;
ELSE GOTO End;
:ModuleOne
pause
IF [%CURR_MODULE%]==[] GOTO ModuleTwo;
ELSE GOTO End;
:ModuleTwo
GOTO End;
:End
Attachments
Step 4: Step 4 - Time to Process the Filelist
Now switch to the filelist file and, using Ctrl+H (a.k.a. Edit-> replace):
1.) remove the unnecessary path at the begining of each file
2.) click just before the first character in this text file and again, using Ctrl+H
reformat the text with a regex:
[Find]:
^(.+)$
[Replace with - oneliner!]:
start "" %CURR_PROG% %CURR_ADDRESS%\1||start "" %CURR_PROG_A% %CURR_ADDRESS%\1||start "" %CURR_PROG_B% %CURR_ADDRESS\1%||start "" %CURR_PROG_D% %CURR_ADDRESS%\1||start %CURR_PROG_D% %CURR_ADDRESS%\1||||pause
when it has finished replacing all, now time to split it readable -> in the replace dialog choose Extended search mode (the middle option) and
[Find]:
||
[Replace with]
\n
1.) remove the unnecessary path at the begining of each file
2.) click just before the first character in this text file and again, using Ctrl+H
reformat the text with a regex:
[Find]:
^(.+)$
[Replace with - oneliner!]:
start "" %CURR_PROG% %CURR_ADDRESS%\1||start "" %CURR_PROG_A% %CURR_ADDRESS%\1||start "" %CURR_PROG_B% %CURR_ADDRESS\1%||start "" %CURR_PROG_D% %CURR_ADDRESS%\1||start %CURR_PROG_D% %CURR_ADDRESS%\1||||pause
when it has finished replacing all, now time to split it readable -> in the replace dialog choose Extended search mode (the middle option) and
[Find]:
||
[Replace with]
\n
Step 5: Final Step: Paste, Optionally Make Some Params, --- Save & Run :))
Now paste the contents at the end of bat file we created at step 3
as you might have noted, at step 3 i defined two modules (divisions in .bat file) -> now move the
GOTO End;
:End
to end of file and
IF [%CURR_MODULE%]==[] GOTO ModuleOne;
ELSE GOTO End;
:ModuleOne
just before the first sitegroup (folder?) and
IF [%CURR_MODULE%]==[] GOTO ModuleTwo;
ELSE GOTO End;
:ModuleTwo
just before the first sitegroup (folder?)
so that final file would look something like:
SET CURR_PROG="%ProgramFiles%\Internet Explorer\IEXPLORE.EXE"
SET CURR_PROG_A="%ProgramFiles%\Opera Mobile Emulator\OperaMobileEmu.exe" -displayzoom 100 -windowsize 480x800 -ppi 240 -user-agent-string Android -profile-name "Samsung Galaxy S"
SET CURR_PROG_B="%USERPROFILE%\Local Settings\Application Data\Google\Chrome\Application\chrome.exe" --new-window
SET CURR_PROG_C="%ProgramFiles%\Mozilla Firefox\firefox.exe"
SET CURR_PROG_D="%ProgramFiles%\Safari\Safari.exe"
SET CURR_MODULE=%2
SET CURR_SITE=%1
IF [%CURR_SITE%]==[after] SET CURR_ADDRESS=http://localhost:8118/
IF [%CURR_SITE%]==[before] SET CURR_ADDRESS=http://localhost:8228/
REM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IF [%CURR_ADDRESS%]==[] GOTO End
IF [%CURR_MODULE%]==[moduleone] GOTO ModuleOne
IF [%CURR_MODULE%]==[moduletwo] GOTO ModuleTwo
REM [Some file list here]
IF [%CURR_MODULE%]==[] GOTO ModuleOne;
ELSE GOTO End;
:ModuleOne
REM [Module one file list ]
IF [%CURR_MODULE%]==[] GOTO ModuleTwo;
ELSE GOTO End;
:ModuleTwo
REM [Module two file list]
GOTO End;
:End
as you might have noted, at step 3 i defined two modules (divisions in .bat file) -> now move the
GOTO End;
:End
to end of file and
IF [%CURR_MODULE%]==[] GOTO ModuleOne;
ELSE GOTO End;
:ModuleOne
just before the first sitegroup (folder?) and
IF [%CURR_MODULE%]==[] GOTO ModuleTwo;
ELSE GOTO End;
:ModuleTwo
just before the first sitegroup (folder?)
so that final file would look something like:
SET CURR_PROG="%ProgramFiles%\Internet Explorer\IEXPLORE.EXE"
SET CURR_PROG_A="%ProgramFiles%\Opera Mobile Emulator\OperaMobileEmu.exe" -displayzoom 100 -windowsize 480x800 -ppi 240 -user-agent-string Android -profile-name "Samsung Galaxy S"
SET CURR_PROG_B="%USERPROFILE%\Local Settings\Application Data\Google\Chrome\Application\chrome.exe" --new-window
SET CURR_PROG_C="%ProgramFiles%\Mozilla Firefox\firefox.exe"
SET CURR_PROG_D="%ProgramFiles%\Safari\Safari.exe"
SET CURR_MODULE=%2
SET CURR_SITE=%1
IF [%CURR_SITE%]==[after] SET CURR_ADDRESS=http://localhost:8118/
IF [%CURR_SITE%]==[before] SET CURR_ADDRESS=http://localhost:8228/
REM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IF [%CURR_ADDRESS%]==[] GOTO End
IF [%CURR_MODULE%]==[moduleone] GOTO ModuleOne
IF [%CURR_MODULE%]==[moduletwo] GOTO ModuleTwo
REM [Some file list here]
IF [%CURR_MODULE%]==[] GOTO ModuleOne;
ELSE GOTO End;
:ModuleOne
REM [Module one file list ]
IF [%CURR_MODULE%]==[] GOTO ModuleTwo;
ELSE GOTO End;
:ModuleTwo
REM [Module two file list]
GOTO End;
:End