Disable DownloadHub / key list for setPreferences - selenium-webdriver

how can I disable that Download window when starting a download via code?
I figured out that I have to set "download.prompt_for_download" to false when I wanna disable the download prompt.
I already tried:
bot.SetPreference "profile.download.manager.showWhenStarting", False
bot.SetPreference "profile.default_content_settings.popups", 0
bot.SetPreference "profile.browser.download.panel.shown", False
bot.SetPreference "disable-popup-blocking", True
But without any access. Who knows the correct key?
Where can I find a list of all keys?
Warm regards

Selenium only works for browser web page automation. The pop-up is not a part of the web page so Selenium will not be able to recognize it.
And I think any setting in Selenium including download.prompt_for_download won't have effect. The pop-up is controlled by the browser setting, and the browser setting is controlled by your group policy, you can't override it with Selenium settings.

Related

How can I stop temporary webextension without shutdown browser?

I was executing webextension on Firefox for testing with about:debugging menu.
Then tests are done, I want to stop it.
I am looking for a way to stop without shutdown browser, but I can't find a way to stop it out.
Is there way for do it without shutdown browser?
Just like a normal add-on, you can disable or remove a temporary WebExtension that was loaded from about:debuging from about:addons (Ctrl-Shift-A, or Cmd-Shift-A on OSX) . If you "Remove" it, and then refresh about:debugging you will see that it is gone from that list.
If you do not refresh about:debugging after disabling or removing it, it will remain in the list that is displayed. This can be convenient if you are testing behavior when the add-on is installed or removed.
The following gif shows loading and removing an add-on named "aaaaaaaaaaaaaaaaaa - demo add-on":
If you do not refresh about:addons after removing an add-on, the add-on will remain in the "uninstalling" state. From that state you can "Undo" the removal/uninstall. This is displayed in about:addons with the "Undo" link. The fact that an extension is in this state is not available to WebExtension add-ons, but can be seen from other Firefox add-ons using the Add-on Manager API. The Add-on Manager API is not compatible with WebExtensions. If you want to take a look at a Firefox Add-on SDK based add-on that shows these states, you can see my answer to another question.

Browser Automation with Selenium: Fingerprints, recognizability and traceability?

I want to use selenium/webdriver to simulate a browser and scrape some website-content with it. Even if its not the fastest method, for me it has many advantages such as executing scripts etc.
For many websites it is forbidden to access them via an automated method, for example search engines like google or bing.
For one tool i need to scrape the estimated resultstat from google for several keywords. This will look like the following: simulate the browser that visits google.com and types in a keyword and scrapes the results, then after a little pause type in the next keyword, scrape the results and so on...
My question is: Is it possible for a website to recognize that I'm using selenium to simulate the browser instead of using the browser by hand? Especially the google case gives me some doubts. I know selenium is partly developed by google or at least by some guys working for google. So does leave selenium some fingerprints or isn't it possible to decide if I'm using the browser by myself or simulated by selenium, even for google?
No, nobody can actually see that you're using Selenium and not hand-operating the browser yourself with WebDriver. I'm not sure about the old Selenium RC, but it should be the same way. Here's how it works:
Selenium opens up a browser with a clean profile (or with a profile you selected)
Selenium is hooked up to the browser so it can steer it, control it. But the browser still does most of the work. Basically, Selenium replaces the user inputs to the browser, but not more.
You can easily verify this by reading the contents of the HTTP headers sent by your browser.
If you ever actually needed Selenium to be recognized by your server, you can use Browsermob-proxy and add a custom header to your requests.
All that said, there is one thing you must be aware of. While there's no way to detect Selenium directly, there can be some indirect clues picked up by the website you're visiting. Those usually include scanning for too many requests made in virtually no time - this might be an issue for you. Make sure your Selenium is behaving like a user.
EDIT 2016/04:
Apparanetly it is possible as https://stackoverflow.com/a/33403473/2930045 states that a company can do it. My guess - and it is nothing but a guess - is that they can run some JS that Selenium installs into the browser to operate.
Signs point to yes, sites are able to regonize that you are using Selenium.
Counter Example: www.stubhub.com detects and blocks my browser instance launched using Selenium while "normal" browsing done manually (not using the browser launched by the Selenium web driver) work with out issue.
See this stackoverflow question for additional details
Can a website detect when you are using selenium with chromedriver?

Issue in clicking on the browse button with selenium in IE

I am Clicking on the browse button in IE using Selenium Webdriver code in an upload file utility by reading the co-ordinates of the browse text. Whlie the code works fine in some machines in IE and firefox both, in yet another machine the same code is working for firefoxx but the browse button becomes unclickable in IE. We checked the settings in internet options, everything looks alike in both machines.
Please let us know if anyone faced any such issue and the resolution that could work.
If there is any other way to upload the file in your app by avoiding the "Browser" button method, then that is always preferred. Some people will use Apache HTTPComponents to do a POST upload to the servlet that the "Browse" button refers to. That is by far the preferred method rather than using WebDriver. The problem with the Browse button is that it opens native OS controls ( in some cases) and the only way you can control those is by using the Sikuli API to click on elements based on finding them with matching screenshots. Also, if you use Sikuli, you can't run multiple browser tests on the same machine since each test will block screen comparisons of another test and that will rule you out of using RemoteWebDriver.

Create a VFP Chrome or FireFox Object

We have a VFP application and need to open a specific site in Chrome or Firefox. The site is optimized for either of those browsers.
We know how to Createobject for InternetExplorer.Application to open a browser inside our application. This allows us to interract with the browser. However, it works only with IE.
Does anyone know how to accomplish the same purpose using either Chrome or Firefox?
We have done this to open the default browser (which is Chrome or Firefox).
oShell = Createobject("wscript.shell")
oShell.Run(lcUrl)
The issue with this approach is that it just opens the browser and we cannot interact with it (e.g. pass values and read items on the page).
At a minimum, if we can open Chrome or Firefox and pass POST parameters without using a querystring that would be an acceptable start.
Chrome doesn't expose an OLE Automation interface so I think you are out of luck with CreateObject(). You might be able to send keystrokes to it somehow but it would be kludgey at best.

Silverlight out of browser WebBrowser block

I've created a silverlight 4.0 OOB application. Inside a menu of the application I've a WebBrowser where I load some predefined webPages. The issue is that those Pages have some links that open a new Internet Explorer instance. I would like to prevent openning that new window, because my application should be the only one running in the computer. I can´t find any event that could give me the information of my app loosing the focus. I don´t know if I can also capture this in the webBrowser.
thanks for the repply!!
UPDATE:
I've found a workaround, In my case I'm sure that the default browser is Internet Explorer, so changing Internet options the problem dissapears. In Internet Options / Privacy / PopUp blocker / Settings, I've set the blocking level to "High" and have unchecked the "show notification bar" checkbox.
Sounds like some of the links in the webpage have a target="_blank" set on them.

Resources