SlideShare a Scribd company logo
1 of 12
EXPLORATORY TESTING TIPS: USE BROWSER
CONSOLE
> Plakogiannis Petros
29/05/2018 2
29/05/2018 3
TASKS
 Create test cases for all the links of the page
 Find all stories for Trump
 Copy all text for reviewing
 Test all the links in header
29/05/2018 4
29/05/2018 5
29/05/2018 6
TIP
29/05/2018 7
1) Inspect a page and see how it built. You might see that all the links are in anch
or tags (’a’)
2) Create a variable called images the represents all the links:
let anchors = $$(‘a’)
3) Write a For Loop to go through each anchor and use console.log to print the
‘href’ value for each anchor. Looks like this:
for (let i = 0;i<
anchors.length; i++){
console.log(anchors[i].href)
}
RESULT: All the Links of the page are displayed.
Find All Links on a Page
29/05/2018 8
Find all Stories for Trump
Use Patterns or Regular Expressions to filter data on a page. Regular Expressions
(RegEx or sometimes called ‘the testers best friend’) are super useful for checking for
proper format or string pattern
$$('h2.story-heading').map(element => element.innerText).filter(text =>
text.indexOf('Trump') > -1).join('nn')
RESULT: All the text with word Trump are displayed
Find Text
29/05/2018 9
1) Inspect to learn a section of the web page. With the section
highlighted/inspected, change the Console section of the Developer Tools.
2) Type $0
3) Press Enter
4) An object that represented the selected section displays.
5) Type $0.innerText and press Enter.
RESULT: All the text in the selected sections displays is returned. You can
read or copy the text to do testing things
Test Links
29/05/2018 10
let anchors=$x("//header/nav/ul/li/a")
console.log("Links that will be tested: "+anchors.length)
for (let i = 0;i< anchors.length; i++)
{
console.log(anchors[i].href);
fetch(anchors[i].href)
.then(function(response) {
console.log(response.url);
console.log(response.status);
})
.catch(function (error) {
console.log('Request failed', error);
});
}
RESULT: HTTP requests returned status 200. This means that requests were
fulfilled. Links work properly
1) Inspect the header navigation bar
2) Collect all the corresponding Links
3) Make HTTP requests, extract values from the responses
Wrap up
Reflect on how you can use these techniques in your daily work and
how the techniques integrate with your idea of exploratory testing.
 Simple approaches can be very useful and easy to add to your skill
collection.
 A little JavaScript can go a long way and give you a lot of
productivity.
Useful Resources:
 Twelve Fancy Chrome DevTools Tips by David Gilbertson :
http://bit.ly/fancychromedevtoolstips
 Command Line API Reference by Andi Smith& Meggin Kearney :
http://bit.ly/commandlinereference
29/05/2018 11
THANK YOU !

More Related Content

Similar to Petros Plakogiannis - Exploratory testing with browser console

Less04 2 e_testermodule_3
Less04 2 e_testermodule_3Less04 2 e_testermodule_3
Less04 2 e_testermodule_3
Suresh Mishra
 
Green Lantern Framework with Selenium IDE
Green Lantern Framework with Selenium IDEGreen Lantern Framework with Selenium IDE
Green Lantern Framework with Selenium IDE
Srilu Balla
 
Lecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
Lecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
Lecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
ZahouAmel1
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
tutorialsruby
 
php-mysql-tutorial-part-3
php-mysql-tutorial-part-3php-mysql-tutorial-part-3
php-mysql-tutorial-part-3
tutorialsruby
 
&lt;b>PHP&lt;/b>/MySQL &lt;b>Tutorial&lt;/b> webmonkey/programming/
&lt;b>PHP&lt;/b>/MySQL &lt;b>Tutorial&lt;/b> webmonkey/programming/&lt;b>PHP&lt;/b>/MySQL &lt;b>Tutorial&lt;/b> webmonkey/programming/
&lt;b>PHP&lt;/b>/MySQL &lt;b>Tutorial&lt;/b> webmonkey/programming/
tutorialsruby
 
php-mysql-tutorial-part-3
php-mysql-tutorial-part-3php-mysql-tutorial-part-3
php-mysql-tutorial-part-3
tutorialsruby
 
Learn CSS From Scratch
Learn CSS From ScratchLearn CSS From Scratch
Learn CSS From Scratch
ecobold
 

Similar to Petros Plakogiannis - Exploratory testing with browser console (20)

Less04 2 e_testermodule_3
Less04 2 e_testermodule_3Less04 2 e_testermodule_3
Less04 2 e_testermodule_3
 
Java script ppt from students in internet technology
Java script ppt from students in internet technologyJava script ppt from students in internet technology
Java script ppt from students in internet technology
 
Html b smart
Html b smartHtml b smart
Html b smart
 
Introduction to whats new in css3
Introduction to whats new in css3Introduction to whats new in css3
Introduction to whats new in css3
 
J Query Public
J Query PublicJ Query Public
J Query Public
 
Green Lantern Framework with Selenium IDE
Green Lantern Framework with Selenium IDEGreen Lantern Framework with Selenium IDE
Green Lantern Framework with Selenium IDE
 
Javascript
JavascriptJavascript
Javascript
 
Prep 2-booklet-2nd-term-2016-2017
Prep 2-booklet-2nd-term-2016-2017Prep 2-booklet-2nd-term-2016-2017
Prep 2-booklet-2nd-term-2016-2017
 
Introduction to JQuery
Introduction to JQueryIntroduction to JQuery
Introduction to JQuery
 
Javascript
JavascriptJavascript
Javascript
 
Lecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
Lecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvvLecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
Lecture 2 HTML part 1.pptxLecture 10 CSS part 2.pptxvvvvvvvvvvvvvv
 
Struts 2
Struts 2Struts 2
Struts 2
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
 
HTML Foundations, pt 2
HTML Foundations, pt 2HTML Foundations, pt 2
HTML Foundations, pt 2
 
Industrial training report
Industrial training report Industrial training report
Industrial training report
 
php-mysql-tutorial-part-3
php-mysql-tutorial-part-3php-mysql-tutorial-part-3
php-mysql-tutorial-part-3
 
&lt;b>PHP&lt;/b>/MySQL &lt;b>Tutorial&lt;/b> webmonkey/programming/
&lt;b>PHP&lt;/b>/MySQL &lt;b>Tutorial&lt;/b> webmonkey/programming/&lt;b>PHP&lt;/b>/MySQL &lt;b>Tutorial&lt;/b> webmonkey/programming/
&lt;b>PHP&lt;/b>/MySQL &lt;b>Tutorial&lt;/b> webmonkey/programming/
 
php-mysql-tutorial-part-3
php-mysql-tutorial-part-3php-mysql-tutorial-part-3
php-mysql-tutorial-part-3
 
[xp2013] Narrow Down What to Test
[xp2013] Narrow Down What to Test[xp2013] Narrow Down What to Test
[xp2013] Narrow Down What to Test
 
Learn CSS From Scratch
Learn CSS From ScratchLearn CSS From Scratch
Learn CSS From Scratch
 

Recently uploaded

"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
mphochane1998
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Kandungan 087776558899
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
jaanualu31
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptx
pritamlangde
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
Kamal Acharya
 

Recently uploaded (20)

"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
8086 Microprocessor Architecture: 16-bit microprocessor
8086 Microprocessor Architecture: 16-bit microprocessor8086 Microprocessor Architecture: 16-bit microprocessor
8086 Microprocessor Architecture: 16-bit microprocessor
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Electromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptxElectromagnetic relays used for power system .pptx
Electromagnetic relays used for power system .pptx
 
fitting shop and tools used in fitting shop .ppt
fitting shop and tools used in fitting shop .pptfitting shop and tools used in fitting shop .ppt
fitting shop and tools used in fitting shop .ppt
 
Worksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptxWorksharing and 3D Modeling with Revit.pptx
Worksharing and 3D Modeling with Revit.pptx
 
Introduction to Artificial Intelligence ( AI)
Introduction to Artificial Intelligence ( AI)Introduction to Artificial Intelligence ( AI)
Introduction to Artificial Intelligence ( AI)
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using PipesLinux Systems Programming: Inter Process Communication (IPC) using Pipes
Linux Systems Programming: Inter Process Communication (IPC) using Pipes
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
Digital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptxDigital Communication Essentials: DPCM, DM, and ADM .pptx
Digital Communication Essentials: DPCM, DM, and ADM .pptx
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 

Petros Plakogiannis - Exploratory testing with browser console

  • 1. EXPLORATORY TESTING TIPS: USE BROWSER CONSOLE > Plakogiannis Petros
  • 4. TASKS  Create test cases for all the links of the page  Find all stories for Trump  Copy all text for reviewing  Test all the links in header 29/05/2018 4
  • 7. 29/05/2018 7 1) Inspect a page and see how it built. You might see that all the links are in anch or tags (’a’) 2) Create a variable called images the represents all the links: let anchors = $$(‘a’) 3) Write a For Loop to go through each anchor and use console.log to print the ‘href’ value for each anchor. Looks like this: for (let i = 0;i< anchors.length; i++){ console.log(anchors[i].href) } RESULT: All the Links of the page are displayed. Find All Links on a Page
  • 8. 29/05/2018 8 Find all Stories for Trump Use Patterns or Regular Expressions to filter data on a page. Regular Expressions (RegEx or sometimes called ‘the testers best friend’) are super useful for checking for proper format or string pattern $$('h2.story-heading').map(element => element.innerText).filter(text => text.indexOf('Trump') > -1).join('nn') RESULT: All the text with word Trump are displayed
  • 9. Find Text 29/05/2018 9 1) Inspect to learn a section of the web page. With the section highlighted/inspected, change the Console section of the Developer Tools. 2) Type $0 3) Press Enter 4) An object that represented the selected section displays. 5) Type $0.innerText and press Enter. RESULT: All the text in the selected sections displays is returned. You can read or copy the text to do testing things
  • 10. Test Links 29/05/2018 10 let anchors=$x("//header/nav/ul/li/a") console.log("Links that will be tested: "+anchors.length) for (let i = 0;i< anchors.length; i++) { console.log(anchors[i].href); fetch(anchors[i].href) .then(function(response) { console.log(response.url); console.log(response.status); }) .catch(function (error) { console.log('Request failed', error); }); } RESULT: HTTP requests returned status 200. This means that requests were fulfilled. Links work properly 1) Inspect the header navigation bar 2) Collect all the corresponding Links 3) Make HTTP requests, extract values from the responses
  • 11. Wrap up Reflect on how you can use these techniques in your daily work and how the techniques integrate with your idea of exploratory testing.  Simple approaches can be very useful and easy to add to your skill collection.  A little JavaScript can go a long way and give you a lot of productivity. Useful Resources:  Twelve Fancy Chrome DevTools Tips by David Gilbertson : http://bit.ly/fancychromedevtoolstips  Command Line API Reference by Andi Smith& Meggin Kearney : http://bit.ly/commandlinereference 29/05/2018 11