Upcoming SlideShare
×

# Automated Testing solution

688 views

Published on

Please note that I just provide this demo document to prove my experience in automated testing.
If you want to watch the demo video on the YouTube, please feel free to contact me.

Published in: Technology
1 Like
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

Views
Total views
688
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
7
0
Likes
1
Embeds 0
No embeds

No notes for slide
• # -*- coding: utf-8 -*- import sys,os import Image class Comp_img(): image_width = 800 image_height = 600 part_width = 50 part_height = 50 part_count = (image_width/part_width)*(image_height/part_height)*1.0 def make_regalur_image(self, img, size = (image_width, image_height)): return img.resize(size).convert(&apos;RGB&apos;) def split_image(self, img, part_size = (part_width, part_height)): w, h = img.size pw, ph = part_size assert w % pw == h % ph == 0 return [img.crop((i, j, i+pw, j+ph)).copy() for i in xrange(0, w, pw) for j in xrange(0, h, ph)] def hist_similar(self, lh, rh): assert len(lh) == len(rh) return sum(1 - (0 if l == r else float(abs(l - r))/max(l, r)) for l, r in zip(lh, rh))/len(lh) def calc_similar(self, li, ri): #return hist_similar(li.histogram(), ri.histogram()) return sum(self.hist_similar(l.histogram(), r.histogram()) for l, r in zip(self.split_image(li), self.split_image(ri))) / self.part_count def calc_similar_by_path(self, lf, rf): li, ri = self.make_regalur_image(Image.open(lf)), self.make_regalur_image(Image.open(rf)) return self.calc_similar(li, ri) def comp_pic(self, ori_dir,comp_dir,diff_dir,similarity): &quot;&quot;&quot; Compare images from two different folders, move them into diff folder if new images are different with original images. &quot;&quot;&quot; #files1 = os.listdir(ori_dir) files2 = os.listdir(comp_dir) count = 0 for i in range(len(files2)): try: percent = self.calc_similar_by_path(&apos;%s/%s&apos;%(ori_dir,files2[i]), &apos;%s/%s&apos;%(comp_dir,files2[i]))*100 print &apos;Img_%d: %.6f%%&apos;%(i, percent) if (percent &lt; similarity): Image.open(comp_dir+&apos;\\\\&apos;+files2[i]).save(diff_dir+&apos;\\\\&apos;+files2[i]) print &apos;Move &apos;+files2[i]+&apos; to &apos;+diff_dir count=count+1 except Exception,e: print &apos;Img_%d: %s&apos;%(i, e) return count if __name__ == &apos;__main__&apos;: c = Comp_img() ori_dir= &apos;C:\\\\Se2\\\\GAP.cn\\\\logs\\\\original&apos; comp_dir= &apos;C:\\\\Se2\\\\GAP.cn\\\\logs\\\\1st&apos; diff_dir= &apos;C:\\\\Se2\\\\GAP.cn\\\\logs\\\\diff&apos; print c.comp_pic(ori_dir,comp_dir,diff_dir,100)
• Report details clearly viewable statistics including Pass/Fail ratios and elapsed times. This gives you great overview on the test execution. Log details statistics from each step of the test execution, from keyword to keyword. It enables you to drill down on the specifics of the test in case of failure or otherwise.
• iostat -xm 5 | awk &apos;{print strftime(&quot;&lt;%H:%M:%S(&quot;),\$0}&apos; &gt; iostat.log &amp; vmstat -n 5 |(while read -r line; do echo &quot;&lt;\$(date +%T:%6N)( \$line&quot;; done) &gt; vmstat.log &amp; jstat -gcutil 54434 1000 conn / as sysdba;set echo off;set veri off;set feedback off;set termout on;set heading off;variable rpt_options number;define NO_OPTIONS = 0;define ENABLE_ADDM = 8;-- according to your needs, the value can be &apos;text&apos; or &apos;html&apos;define report_type=&apos;html&apos;;begin:rpt_options := &amp;NO_OPTIONS;end;/variable dbid number;variable inst_num number;variable bid number;variable eid number;begin select max(snap_id)-5 into :bid from dba_hist_snapshot;select max(snap_id) into :eid from dba_hist_snapshot;select dbid into :dbid from v\$database;select instance_number into :inst_num from v\$instance;end;/column ext new_value ext noprintcolumn fn_name new_value fn_name noprint;column lnsz new_value lnsz noprint;--select &apos;txt&apos; ext from dual where lower(&apos;&amp;report_type&apos;) = &apos;text&apos;;select &apos;html&apos; ext from dual where lower(&apos;&amp;report_type&apos;) = &apos;html&apos;;--select &apos;awr_report_text&apos; fn_name from dual where lower(&apos;&amp;report_type&apos;) = &apos;text&apos;;select &apos;awr_report_html&apos; fn_name from dual where lower(&apos;&amp;report_type&apos;) = &apos;html&apos;;--select &apos;80&apos; lnsz from dual where lower(&apos;&amp;report_type&apos;) = &apos;text&apos;;select &apos;1500&apos; lnsz from dual where lower(&apos;&amp;report_type&apos;) = &apos;html&apos;;set linesize &amp;lnsz;-- print the AWR results into the report_name file using the spool command:column report_name new_value report_name noprint;select &apos;awr&apos;||&apos;.&apos;||&apos;&amp;ext&apos; report_name from dual;set termout off;spool &amp;report_name;select output from table(dbms_workload_repository.&amp;fn_name(:dbid, :inst_num,:bid, :eid,:rpt_options ));spool off;set termout on;clear columns sql;ttitle off;btitle off;repfooter off;undefine report_nameundefine report_typeundefine fn_nameundefine lnszundefine NO_OPTIONSexit
• Report contains an overview of the test execution results. It shows TPS of subsystem, CPU utilization, database AWR report. The report has links to trend chart, these trend charts shows builds performance trend, normally, a nearly horizontal line is expected result.
• ### Automated Testing solution

1. 1. Automated Testing SolutionsFor ALDO
2. 2. Overview Test Framework and Tools Test Automation and Continuous Integration Solution Functional Test Automation Framework Server Side Performance Test Automation Structure DB Architecture and Design Verification Browser Side Performance Test Solution
3. 3. Test Framework, Tools, Programming LanguageYslow
4. 4. Web-based Application Testing ToolsTiers Functional testing PerformanceTestingUI Tier Robot FrameworkSe2, Image LibraryDynatraceYslow, FirebugBusiness Logic Tier Junit, Jmeter,SoapUIJmeter, Javaprofiler, JstatDB Tier Robot FrameworkDB LibraryJmeter, AWR, Linuxmonitoring toolsJenkins, Emma code coverage
5. 5. No problem sir, I’ll build the applicationand run the test suites at night, you willreceive an email with functional testing,performance testing report and testcoverage tomorrow morning.
6. 6. Test Automation & Continuous Integration Solution
7. 7. Test Suites/ Test Cases/KeywordsIE, Firefox, ChromeOr simulatorsTest libraries APIRobot FrameworkTest data syntaxTest library APIBuildIn SSH DB ExtensionApplication interfacesSystem Under TestSimulator interfacesFunctional Test Automation SolutionTools: Jenkins, Selenium2, Robot Framework, EMMA code coverage
8. 8. Extend Test Library For UI Layout TestingClass Name: Screenshot ComparisonAlgorithm: Histogram similaritySim(G,S)=Source Code: To see the comment…
9. 9. Robot Framework Test Data Editor
10. 10. Keyword-driven and Data-driven approach
11. 11. HTML Reports, Logs, Code Coverage Reports
12. 12. Server Side Performance Test Automation StructureTools: Jenkins, JMeter, JAVA monitoring tools, Linux monitoring tools, AWR
13. 13. Monitoring Tools & Scripts Iostat Vmstat Jstat Oracle AWRTo see the details in the comment…
14. 14. DB Architecture and Design Verification
15. 15. HTML Performance Test Reports
16. 16. AWR report
17. 17. Browser Side Performance Test Automation SolutionTools: Jenkins, Yslow, DynaTrace AJAX Edition YSlow analyzes web pages and why theyre slow based onYahoo!s rules for high performance web sites. Dynatrace AJAX Edition analyzes the front-end performance ofyour web-pages and Identify slow running JavaScript handlers,customs JavaScript code slow access to the Dom, expensiveCall. Integrating Yslow and Dynatrace into Jenkins is my future job…
18. 18. Yslow Test Reports
19. 19. Dynatrace AJAX Edition Test Reports
20. 20. Demo Demo video for Web-based application regressiontesing.avi