chrome always open these type of links in associated app checkbox is missing in selenium - selenium

When I opened selenium with python, I can't find the always open these kinds of links with associated app checkbox anymore.
People suggested me to use the registry editor to enable it and yes it worked but when I opened the selenium again with my python script it doesn't work! As in don't work I mean the checkbox is displayed but selenium doesn't remember it anymore. Any suggestions?

Ooo , i think i know what your problem is. The reason why selenium doesn't remember your changed settings was because you don't use the same chrome profile in your python script. Try this:
options = Options()
options.add_argument(r'user-data-dir=path\to\your\chrome\profile')
driver = webdriver.Chrome(executable_path=r'path\to\your\chromedriver.exe', options=options)```
If you don't know how to check your profile, go to your webbrowser and type chrome://version and scroll until you can find the profile path subheading! Cheers, and good luck.

Related

New error discovered when using Chromedriver Selenium

When I try to open Chrome with selenium with webdriver, it shows a chrome that looks like this.
Even though it's been a long wait, it's still the same. While I open it by right clicking, it works fine.
I've tried using all versions of Chromedriver 100 and 99, but the results haven't changed much.
Here is the source code that I use:
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument(f"--user-data-dir=G:\\Multi_Chrome\\testing\\Data\\profile")
driver = webdriver.Chrome(service=Service("D:\\Python\\Project\\chromedriver.exe"),
options=chrome_options)
input("Press any key to coutinue ...")
driver.close()
driver.quit()
Any ideas? By the way, I want to ask more, how to open a normal portable chrome. Instead of right clicking and choosing open. Is there a way to automatically open it?
I have partially mentioned it in this article: Open a complete portable chrome like regular Chrome
your question isn't clear because you didn't mention what is the error, but as I see in the screenshot you have already opened one chrome browser before you run the script, but you use --user-data-dir=G:\\Multi_Chrome\\testing\\Data\\profile it means that this profile is already is in use so you cant open another chrome browser with the same profile. so The simplest and easiest fix is to close all running chrome browsers and after that try to run your script again

Accept downloads automatically in Selenium WebDriver using IEDriver

How I can accept downloads in Selenium using InternetExplorerDriver.
Now when click to download file, Save As Dialog appears and then WebDriver stop the work.
I try to search a capability to set this how in ChromeDriver is just only add chromedriver.AddUserProfilePreference("download.prompt_for_download", false);
but I not found.
I need when driver click in button to download, the download automatically start and save in any folder.
Sorry my bad question. I'm new here.
I don't have windows machine so i couldn't check this but try following article. There is a registry which you need to modify to get such behavior. Let me know if it works.
https://jwcooney.com/2014/03/31/remove-internet-explorer-open-or-save-popup/
found another thread discussing the same thing
https://superuser.com/questions/246553/how-to-disable-file-download-popup-in-internet-explorer

Selenium scripts fail after newest Windows update

I have a question regarding Selenium and the current Microsoft updates:
I just installed the newest Microsoft patches on a PC and now the Selenium scripts won't work anymore. I'm using the Selenium IE Driver 2.44.0 in the scripts. Maybe something has changed in the Internet Explorer, I'm not sure. Suddenly the scripts can't find any web elements on the page anymore. An InvalidSelectorException is thrown because the findElements methods can't be executed. The IE driver opens up and it navigates to the given URL, but when it tries to find a web element, the script fails. I also tried it out on a PC which hasn't the newest updates installed yet and the scripts are working fine there, there are no problems at all.
Do you have any ideas what to do or what could be the cause?
Thanks a lot!
Yes as I stated here
If you have taken windows update KB3025390 IE will not work as expected. There is currently no resolution to that yet.
Also, Uninstalling the update KB3025390 should make the WebDriver work correctly with Internet Explorer 11. See this answer

Access Windows Print button from IE WebDriver selenium

I am using 32bit IE Webdriver and Selenium 2.0 and IE9 (VS2010 vb.net Test project) Is it possible to pass Accept to Word documents Print screen which is invoked by javascript. Surprisingly it is not an Alert nor a Modal so i cannot access using WindowsHandle nor Alert. I am newbie to this can anyone help?
Thanks,
Gauls
I think you can use AutoIT tool, I was searching and got this - may be it help you:
link

Robot Framework browser support

Has the robot framework support for IExplorer or only for Firefox and Chrome?
(If yes, how to configure it?)
Thanks!
Robot Framework does not, in itself, support any particular browser, so I am guessing you are referring to either SeleniumLibrary or Selenium2Library which use selenium and selenium 2 respectively. The browser support of these is well documented at seleniumhq and there is much support out there. It is recommended for new projects to use Selenium2Library as this will receive ongoing support.
Please check the driver compatiblity for browser.
You might have already known of IE driver.
Apart from that you also need to check Python version- Selenium2 version - IE Driver version - IE browser version compatibility.
In addition to #theheadofabroom 's answer, I should add that Internet Explorer does not play well with Robot Framework. Your test might not work for any number of reasons on IE while it may work just fine on FireFox and Chrome, but the most common is timing. IE is just slow enough that when Robot Framework goes to click on the next element, it searches the page for it, but it hasn't loaded in yet. As long as you have the Selenium webdriver for IE installed correctly and have written your Robot Framework code correctly, I'd recommend adding some Sleep keywords between actions to slow your code down and increase the probability that the element you want to click will load before Robot Framework searches the page for it. This is especially true if you're writing for Chrome and want to send it to either Firefox or IE.
Open Browser ${WEBAPPURL} ${BROWSER} is the keyword to open the browser.
For Firefox you can use firefox/ff instead of ${BROWSER}
For Google Chrome you can use googlechrome/gc/chrome instead of ${BROWSER}
For Internet Explorer you can use internetexplorer/ie instead of
${BROWSER}
For Firefox you don't need any driver but IE and Chrome you need to install the drivers
You can find the installers in and info here for Chrome and here for IE
Download IEdriver exe from here and put this exe file in Scripts folder of your Python installation directory. For eg, in my case it is C:\Python27\Scripts.
Ride will now launch IE for you.
Robot class supports keyboard inputs regardless of the browser. It is a class from the java.awt package and not specific to any browser. It is used in automation for performing operations on the web browser(stand alone application) in which a web-page is being automated
Note that it cannot perform operations directly on the web browser as it's a stand alone application, but can make use of keyboard shortcuts to indirectly perform the operation.
For example, if you want to open a new tab in a browser, you can use the Robot class to press Ctrl+t instead of trying to click on the new tab.
Code to use it to open a new tab in your program
Webdriver driver = new ChromeDriver(); //FirefoxDriver(), IntrrnetExplorerDriver();
driver.get("......");
//code goes here
//to open a new tab
Robot rob = new Robot();
rob.keyPress(Keys.VK_CTRL);
rob.keyPress(Keys.VK_t);
rob.keyRelease(Keys.VK_CTRL);
rob.keyRelease(Keys.VK_t);
//itetator to switch between the tabs