VBA Selenium - Close "Frame" or "Overlay"

toughie

New Member
Joined
Oct 10, 2018
Messages
43
Hi MessageBoard,

Looking for a little help on closing a pop up on a website, i am unable to get Xpaths.

I can locate the Page Source and Frame source but unsure how to close the pop up. I have searched multiple sites and i am now stuck, i am a beginner just stepping into chrome control via vba.

Pop up image attached. Website (Mercer Money)

1636800623910.png
 
You have to switch to the overlay's iframe and then click the X to close it.
VBA Code:
    Dim driver As Selenium.ChromeDriver
    Dim iframe As WebElement
    Dim overlayLink As WebElement
    '...after loading page
    Set iframe = driver.FindElementByXPath("//iframe[@title='Usabilla Feedback Form']", 100, False)
    If Not iframe Is Nothing Then
        driver.SwitchToFrame iframe
        Set overlayLink = driver.FindElementById("close", 100, False)
        overlayLink.Click
    End If
 
Upvote 0
Solution
1640766673614.png


Thanks for the help John, i added in the code but now getting anerror on browser/ Chromedriver versions, i have updated the version and dropped it into previous chromedriver location but bug wont clear, any idea what i need to do, ran a few troubleshooting tasks from google but no luck!
 
Upvote 0
View attachment 54124

Thanks for the help John, i added in the code but now getting anerror on browser/ Chromedriver versions, i have updated the version and dropped it into previous chromedriver location but bug wont clear, any idea what i need to do, ran a few troubleshooting tasks from google but no luck!
I managed to resolve this issue!
 
Upvote 0
View attachment 54124

Thanks for the help John, i added in the code but now getting anerror on browser/ Chromedriver versions, i have updated the version and dropped it into previous chromedriver location but bug wont clear, any idea what i need to do, ran a few troubleshooting tasks from google but no luck!
John,

Got past previous issue!

1640768226274.png



Now getting this message, can you assist?
 
Upvote 0
Hey John, error line in screenshot below.

Can you also assist on a line of code to wait for the iframe to load?

1641668020729.png
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top