Dealing with elements behind pop-up windows


I am running across this issue throughout our application where confirmation windows will appear during each step of a transaction and elements are still visible in the background.

The problem is the script will click on the elements in the background before the confirmation has a chance to close (there seems to be a delay to close the confirmation window).  What is the best way to handle this?

Note:  I don’t see any attributes on the element in the background to indicate if its Enabled or Disabled.

<input type="button" name="ctl00$TemplateBody$ucNewMembership$ucMemberContact$btnContinue" value="Continue" onclick="javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$TemplateBody$ucNewMembership$ucMemberContact$btnContinue&quot;, &quot;&quot;, true, &quot;MemberInfo&quot;, &quot;&quot;, false, true))" id="ctl00_TemplateBody_ucNewMembership_ucMemberContact_btnContinue" tabindex="100" class="runOnce">

twiggy_42 Default Asked on February 18, 2016 in Selenium WebDriver.
Add Comment
1 Answer(s)

Can you use a explicit wait using ExpectedCondition method  invisibilityOfElementLocated(By locator) to verify if any of the element in the confirmation window is present before clicking the element in the background.

Kalai Default Answered on February 19, 2016.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.