1

2) A pop will display showing to enter email address to register.

3) Since it is not a pop up I am not able to navigate to the window

I tried using alerts, javascriptexecutor and windowhandles but does not work. Could any suggest how to handle it?

  • According to the Best Buy policies, `Unless we separately give you permission, you may not copy, scrape, frame, modify, remove, delete, augment, add to, publish, transmit, participate in the transfer or sale, lease or rental of, create derivative works from, or in any way exploit any of the Content, in whole or in part.` So you shouldn't be scraping their site. Marking this question to be deleted. – JeffC Sep 19 '15 at 03:59
  • Its a modal-POP UP. It don't required any switchTo(). Just add `.implicitlyWait` (recommended) or sleep – Ravichandra Sep 21 '15 at 07:14

1 Answers1

1

This is not a popup window. Locate it as you would locate any other element on a page.

For instance, here is how you can locate the "close" button and click it:

WebDriverWait wait = WebDriverWait(driver, 10);
WebElement closeButton = wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector("div.modal button.close")));
closeButton.click();

Note that we are using a WebDriverWait explicit wait mechanism to wait for the close button to become visible.

alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195