Resource
Article [7182]
General
[1032]
Acceptance
[63]
Ad Hoc
[28]
Agile, Scrum
[231]
Black Box
[117]
Bug, Defect
[258]
DB, Test Data
[274]
Environment
[42]
Functional
[115]
Glossary, Term
[74]
GUI, Usability
[98]
Integrate test
[46]
Interview, FAQ
[285]
Manual Testing
[117]
Methodology
[231]
Metrics
[327]
Mobile, Embed
[153]
Performance
[327]
Process
[194]
Requirement
[124]
Review, Static
[102]
Risk
[99]
Security Test
[215]
Standard, ISO
[179]
Test Automate
[348]
Test Case
[341]
Test Design
[69]
Test Plan
[311]
Test Manage
[227]
Test Script
[56]
Test Technique
[265]
Tool
[175]
Tool- Jmeter
[40]
Tool- Selenium
[125]
Unit Test
[166]
Web Test
[258]
White Box
[70]
Ebook [1164]
General
[278]
Acceptance
[3]
Agile, Scrum
[24]
DB Test
[76]
Development
[137]
GUI, Usability
[17]
Interview, FAQ
[9]
Java Test
[68]
Metrics
[17]
Mobile, Embed
[14]
Performance
[49]
Process
[11]
Requirement
[55]
Review, Analysis
[8]
Risk
[7]
Security Test
[71]
Standard
[20]
Test Manage
[85]
Test Automate
[84]
Tool
[8]
Unit Test
[67]
Web Test
[60]
Testing Tool [2276]
Acceptance
[25]
Agile, Scrum
[42]
Bug Tracking
[127]
Build, Release
[27]
Environment
[58]
DB, Test Data
[83]
Functional
[240]
GUI, Usability
[79]
Java Test
[71]
Metrics
[57]
Mobile, Embed
[79]
Network Test
[67]
Performance
[222]
Requirement
[62]
Review, Static
[105]
Security Test
[111]
Test Design
[52]
Test Manage
[208]
Unit, Debug
[224]
Utility, Capture
[97]
Web Testing
[234]
Video [622]
News [2773]
Webinar [914]
Certification Resource
CTAL [271]
CTEL [35]
CSTE, CSQA [198]
CSQE [41]
CMMI, TMMI [135]
PMP [114]
ITIL [67]
Six Sigma [41]
Other [81]
Forum
Forum [1935]
Book
[56]
Certification
[48]
Conference
[64]
ISTQB
[158]
QTP
[92]
Software Test
[1062]
Standard, ISO
[89]
Testing Tool
[287]
vivekjog
2011.12.02 13:43:37
1546
As per my understanding Pop-Ups are classified into three types.
1.) JavaScript alerts:
By default Selenium suppress the alerts during test execution, so not
visible on the browser. If the alerts are not handled properly Selenium
through following exception
"com.thoughtworks.selenium.SeleniumException: ERROR: There was an
unexpected Confirmation! [Do you want to Continue?]". This alert is
further classified into "ok" , "ok and cancel" alert. This alert can be
handled in the following way.
assertEquals("Saved Sucessfully!", s.getAlert()); // After click
s.chooseOkOnNextConfirmation(); // Before Click
s.chooseCancelOnNextConfirmation(); // Before Click
s.getConfirmation(); // After click
For "ok and cancel" alert, you need to consume the alert with
"s.getConfirmation();" other wise it will display the exception saying
"ERROR: There was an unexpected Confirmation!". Basically you should be
using two statements: (ok/cancel)conformation before the click and
consume after the click.
If you insert an alert statement when there is no alert on the web page,
selenium will display following exception -
com.thoughtworks.selenium.SeleniumException: ERROR: There were no alerts
2.) HTML Pop-Ups using JQuery or other techniques :
Here popup is constructed using div and is visible on the screen. This can be handled in the following way
s.click("popup_ok")
s.click("popup_cancel")
3.) Windows Pop-Ups :
These are windows based popup and is visible on the screen. Selenium is
not capable to handle this kind of pop-up, need to use AutoItv3. To
handle this pop-up record the script in AutoItv3, convert into exe
format and then call from Java program.
Runtime.getRuntime().exec("C:\\OKbtn.exe ");
WinWaitActive("#32770", "Message from webpage",10)
WinFlash("Message from webpage","", 4, 500) ; Just to Flash the window
ControlClick("Message from webpage", "","[CLASS:Button; INSTANCE:1]");
second Method
you can always use Java Robot library and imitate pressing e.g. Enter key
Robot robot = new Robot();
robot.keyPress(KeyEvent.VK_ENTER);
robot.keyRelease(KeyEvent.VK_ENTER);
or define firefox profile to not display popups.
Thanks
Vivek
Get more Testing documents : http://testingking.weebly.com/poll-of-the-day.html
Service
New
Popular Documents
Monthly
Yearly
Popular Download
Weekly
Monthly
Twitter
Tag List
Exam
tool
Test Automation
Unit Testing
test plan
Metrics
Performance Testing
Manual
Plan
agile
Selenium
Sample Exam
Test
web testing
Test Case
conference
agile testing
Automation
Bug
mobile
Software
framework
QTP
Development
Software Testing
PM
Template
ISTQB
testing
software testing company
Test management
process
security testing
QA
Questions
outsourcing software testing
HP
Sql
mobile testing
Guide
QC
Certification
Management
tester
Interview
performance
mobile application testing
web
software qa service
security
Quality
Visitor
Member Login (IP)
233992
129528
203409238
Yesterday
Today
Total

 
 
