Sunday, 15 June 2014

Watir webdriver - modal popup - Other element would receive the click -



Watir webdriver - modal popup - Other element would receive the click -

want click element on modal popup window. this answer helped me lot finding appropriate element, seems other div chosen (and clicked). popup code is:

<div id="reports-loader" class="modal" tabindex="-1" style=""> <div class="modal-header"> <h3 class="modal-title">super title</h3> </div> <div class="modal-body"> <iframe src="//some_source" width="640" height="360" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen=""> </iframe> <div id="reports-loader-skip-intro"> <a href="#" data-dismiss="modal" class="btn btn-large welcome-button skip gray" style="display: inline-block; width: 33%">skip</a> <a href="#" data-dismiss="modal" class="btn btn-large welcome-button skip try-now-redirect" style="display: inline-block; width: 66%">try feature</a> </div> </div> </div> <div id="reports-backdrop"></div>

the "reports-backdrop" div gray area covering whole browser window, beneath popup (the "reports-loader").

the code using skip link is:

popup = @browser.div(:id => 'reports-loader', :class => 'modal') puts popup.div(:class => 'modal-body').a(:text => 'skip').exists? popup.div(:class => 'modal-body').a(:text => 'skip').click

and puts returns true. unfortunately, wanted element not clicked, "reports-backrop" div used:

true # <-- puts printout selenium::webdriver::error::unknownerror: unknown error: element not clickable @ point (101, 115). other element receive click: <div id="reports-backdrop" style="opacity: 0.7141267829936161;"></div> (session info: chrome=35.0.1916.153) (driver info: chromedriver=2.9.248315,platform=windows nt 6.1 sp1 x86_64) (eval):1:in `process_watir_call'

what ok in whole situation - seems button clicked, since popup disappears (with no clicking stays on screen). unfortunately, due error test failed. have clues...?

popup webdriver watir

No comments:

Post a Comment