VBA Selenium Chromedriver - Issue with SetPreferences not turning off Save As dialog

https://i.stack.imgur.com/yGpGE.pngI have encountered an issue with a program where I am attempting to bypass the SaveAs dialog box when opening a PDF file. Despite using SetPreferences, the dialog box continues to appear. Has anyone successfully disabled the SaveAs dialog using SetPreferences before?

Could it be that I am placing these preferences in the wrong part of the program? My understanding was that this should happen prior to starting the bot.

Sub CompanyName()

Dim bot As New Selenium.WebDriver

MyFolder = ThisWorkbook.Path
bot.SetPreference "download.default_directory", MyFolder
bot.SetPreference "download.directory_upgrade", True
bot.SetPreference "download.prompt_for_download", False

bot.Start "Chrome", "https://www.intacct.com/ia/acct/login.phtml?[![enter image description here][1]][1]_ga=2.13247287.1007588550.1536894830-1229002215.1536894830"
bot.Get "/"


bot.FindElementById("company").SendKeys "Company ID"
bot.Wait 500
bot.FindElementById("login").SendKeys "Username"
bot.Wait 500
bot.FindElementById("passwd").SendKeys "Password"
bot.Wait 500
bot.FindElementById("retbutton").Click

Stop

'bot.SwitchToParentFrame
Dim menuitem As WebElement
Set menuitem = bot.FindElementByCss("#mainmenu > div > div:nth-child(7) > div.iamenutitlewrapper > span")

bot.Actions.MoveToElement(menuitem).Perform
bot.FindElementByXPath("//span[@class='iamenutitle'][contains(text(),'Accounts Payable')]").Click
bot.FindElementByCss("#mainmenu > div > div:nth-child(7) > div.iamenu.mega.setup-closed > div > div > table > tbody > tr:nth-child(5) > td:nth-child(2) > span:nth-child(2)").Click
bot.SwitchToFrame "iamain"

bot.FindElementByName("F_RECORDID").SendKeys "123"
bot.SendKeys bot.Keys.Enter
bot.Wait 500
bot.FindElementByLinkText("View").Click
bot.Wait 500
bot.FindElementByCss("span.buttons.view_attachment").Click
bot.SwitchToNextWindow
bot.SendKeys bot.Keys.Control, "s"

Answer №1

It looks like everything is in good shape! If you're experiencing issues, it could be due to an outdated version of the Selenium Driver. I recommend updating your driver by visiting the official download page here.

I truly hope this information proves useful for you. Warmest regards, Pedro Azzam.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Selenium error: Unable to detect symbol

After following a tutorial on YouTube, I decided to copy and paste the code generated by Selenium IDE export function into my class file instead of typing my own. However, I encountered several errors with unknown symbols. I thought Maven was supposed to r ...

Is it possible to extract data from tables that have the 'ngcontent' structure using Selenium with Python?

Scraping basic tables with Selenium is a simple task. However, I've been encountering difficulties when trying to scrape tables that contain "_ngcontent" notations (as seen at "https://material.angular.io/components/table/overview"). My goal is to con ...

Can Selenium Be Used Without the Need to Install the Chrome App?

Is it possible to utilize Selenium without having to download the entire Google Chrome application? This question crossed my mind when I noticed that Selenium runs smoothly on replit, but encounters errors when run on VS Code on my computer (which lacks Go ...

I must interact with the video within the iframe by clicking on it

I am trying to interact with an iframe video on a webpage. Here is the code snippet for the video: <div class="videoWrapper" style="" xpath="1"> <iframe width="854" height="480" src="xxxxxxx" frameborder="0" allow="autoplay; encrypted-media" all ...

During the second test, Selenium was unable to locate the element

Encountering the same issue with every test script I attempt to create using selenium + TestNG. After the first @test method, webdriver fails to identify elements in the following @test methods. Illustratively, consider the scenario: The web driver loads ...

Java programming language, Selenium WebDriver

Here is a snapshot of the Login popup: https://i.stack.imgur.com/iBal9.png I am new to Selenium webdriver and I have written some code to test navigation commands. However, when the browser opens, a login popup appears that I am unable to close using clas ...

Using Selenium WebDriver to Extract Variables from JavaScript SourceCode

Currently, I am dealing with a web page source code that utilizes JavaScript to display text. Below is an excerpt from the source: var display_session = get_cookie("LastMRH_Session"); if(null != display_session) { document.getElementById("sessionDIV") ...

Converting Unix timestamp to date and time using Pandas

After a considerable amount of time searching, I finally found a solution to my issue. To extract data from the desired column, I utilized the following code snippet: import pandas as pd df = pd.read_excel("Live_data_test.xlsx","Sheet1") number_of_entri ...

I am encountering difficulties with searching inside elements using Python Selenium

Struggling to find elements inside another element, the expected functionality is not there. I am dealing with a table where I need to iterate and update records if a certain cell in a row is empty. I have a list of web elements to go through for iteratio ...

Is there a way to transfer my existing Chrome profile to Selenium for testing purposes?

I am seeking a way to utilize Selenium in conjunction with my existing Chrome profile, even if it is currently being used. My goal is to initiate Selenium automation that can recognize any cookies set in my current Chrome session and have the ability to mo ...

"Encountering Captcha: Google Challenges Users in Search Results with Python

Currently, I am experimenting with selenium and webdriver using python to enhance my skills. from selenium import webdriver PROXY = "119.82.253.95:61853" url = 'http://google.co.in/search?q=book+flights' chrome_options = webdriver.ChromeOption ...

What is the best way to verify that a page has successfully reloaded after clicking a link that navigates to the current page?

I have encountered a peculiar issue that I am attempting to replicate through testing. While I have identified the source of the problem and know how to resolve it, I am struggling to create an effective test case for it. Here is the scenario: I have my ...

What could be causing the issue of being unable to scroll down the page with Selenium 2?

I already have gecko driver installed and I am a bit confused about why the page scroll down is not working properly. The console is not showing any errors even though I have specified that the test case should fail if a certain condition is not met: packa ...

Discover the most up-to-date version of the Chrome driver for seamless integration with Selenium

I am looking for the most up-to-date Chrome driver to run my Selenium project. I attempted to follow the link provided by Visual Studio Code, but the highest version I could find is 114. The latest version available for download is actually 122.0.6261.95 ...

Guide on capturing a screenshot with consistent window size using Selenium in Python

I'm running into an issue where I want to capture a screenshot in headless mode using Selenium at a specific resolution, but the saved image is turning out to be at a different resolution despite setting the window size: from selenium import webdriver ...

Establishing the preferences for downloads within my initial configuration process

I have set up the download preferences in the setup method so that I don't have to define them separately every time I need to download a file. However, I am facing an error: self.driver = webdriver.Chrome(options, executable_path=r"C:\chromedri ...

Building a web application with Spring Boot while incorporating the use of Selenium WebDriver

As I delve into the realm of spring boot, I find myself facing a challenge in integrating selenium into my application. The goal is to create a basic web page with an input box and button. Users should be able to enter a URL in the input box, which will th ...

Navigating through the properties of an IWebElement object

In my current project, I am using C# and Selenium with the page object model approach to automate testing on a website. I have implemented a page object that includes a list of IWebElement properties representing various buttons and links on the website t ...

What is the process for extracting data from MS 97-2003 Worksheet using Selenium Webdriver?

I am attempting to access and read the .xls file (MS 97-20003 Worksheet) that has been downloaded from our application using Selenium WebDriver. However, I am encountering the following error: "org.apache.poi.poifs.filesystem.NotOLE2FileException: The sup ...

Generating several .json documents from an Excel file containing multiple sheets with the help of Pandas

I have a challenge converting a large number of Excel Files, each with multiple sheets (some of them quite large), into .json files. To tackle this, I compiled a list containing the names of the sheets and then implemented a loop to generate a data frame f ...