Python - Using a browser other than Chrome with webbot package - python-3.x

I am new to programming and my first task, which should be really simple, is to automate a proccess, where I log in in a website with my credentials, I click on some buttons and that is it. I am using Python 3.6 on windows 10.
I am trying to do it using the webbot module, which so far has come really handy but I have one big problem.
The standard browser for webbot is Google Chrome and thus the site always opens with Chrome. I need to open the site with Internet Explorer.
I have set IE as default browser, but nothing changed, Chrome would still open.
I deleted Chrome, but then when I would run the programm nothing would happen.
I checked the init.py file and the drivers folder of the module and I think that this module can only work with chrome.
Is it possible to use IE or does this mean that this package does not support this browser at all?
Which alternatives would you suggest?
Edit: If I am not mistaken Selenium does not support IE11 on windows 10, so that is not an option, unless I am mistaken.
Thanks in advance

There is no support for another browser other than Chrome (as far as the webbot module is concerned).

Related

Disable automation warning in Safari when using selenium

I Would like to perform tests in safari, using selenium.
Unfortunately, when I try to debug issues using the safari, a notification appears which requires me either disable automation in safari or to quit (attached image).
why I cannot do it as in Chrome & FireFox (for ex: press F12 to see the DOM) ?
Note: I'm using MacOs Catalina with Javascript & Python for selenium
This error message...
...implies that the Safari browser's WebDriver support for developers and automation developers is turned off by default.
Configure Safari to Enable WebDriver Support
As per the documentation in Testing with WebDriver in Safari Safari's WebDriver support for developers is turned off by default. Enabling the WebDriver support depends on your operating system.
In High Sierra and later:
You need to enable safaridriver once.
/usr/bin/safaridriver --enable
If you’re upgrading from a previous macOS release, you may need to use sudo as follows:
sudo /usr/bin/safaridriver --enable
Sierra and earlier:
To make the Develop menu available. Choose Safari > Preferences and on the Advanced tab, select Show Develop menu in menu bar.
Choose Develop > Allow Remote Automation.
Authorize safaridriver to launch the XPC service that hosts the local web server. To permit this, manually run /usr/bin/safaridriver once and follow the authentication prompt.
Unfortunately we don't seem to be able to pause the tests, interact with the browser and then resume the tests afterwards with safaridriver, as we can with geckodriver and chrome webdriver.
The closest option you have is to 'Stop Session' in the pop-up from your screenshot.
From what I can see the 3 options listed are:
Turn off all automation - Stops the test and turns off all the automation settings. This will require you to allow remote automation/enable safaridriver again.
Stop session - this stops the test but leaves the browser open so that you can manually interact with it and use the Web Inspector tools.
Continue session - this closes the pop-up and continues with the test.
So, to summarize for all other (frustrated) developers who come across #Safari and try to automate it.. it is impossible to write automation because of this limitation.
So the options are:
Write in other browser (such as chrome) and verify it works in safari
Manually in other session in safari(manual) locate your locators/paths and then insert to you automation-infra
and to add to complexity - Selenium clicks doesnt work in many places where on chrome/ff/edge DO work.
so, possible solution to that - is to use JS in DOM - but that is also not perfect.
hopefully the situation will improve
This should solve your problem.
warnFromSafari = driver.SwitchTo().Alert();
warnFromSafari.Accept();

Google Chrome shows no text/fonts when opened with selenium

So i was using some python scripts for automating some stuff in google chrome. Since yesterday i experience a really strange bug. When i use
the script to open Google Chrome via selenium, all Websites look like this:
Screenshot
I blurred out the faces, they get displayed perfectly. But there is absolutely no text getting displayed, not even in console. This worked for
weeks now and all of the sudden it looks like this.
Any Ideas how to fix it?
I tried reinstalling Chrome and chromedriver, without success.
Updating to Google Chrome Version 68.0.3440.25 (Build officiel) beta (64 bits) fixed my problem
Change your system language to English to solve this problem
have a look if the disable-gpu comand line flag for chrome helps you
https://github.com/karma-runner/karma-chrome-launcher/issues/183#issuecomment-401820926

Xdebug client default browser

I'm using Sublime Text 3.
When I go to Tools -> Xdebug -> Start Debugging (Launch Browser), Internet Explorer launches, although I have set Google Chrome to be my default browser in Windows 10 Settings.
I tried looking into Sublime Text settings files but I did not find anything concerning default browsers.
Is there a way to fix it?
XDebug Client (which I assume you're using) uses Python's webbrowser module to launch your browser. Apparently, something is wrong with your Windows setup, or the way the default browser is defined has changed, as webbrowser's default functionality isn't working. You can try it by opening Sublime's console (View -> Show Console or Ctrl`) and entering the following code:
import webbrowser; webbrowser.open("https://www.google.com")
I would imagine based on your problem that IE will open.
The only way I know of to get around this, short of modifying the code for XDebug, is to set the BROWSER environment variable to the complete path to the Chrome executable. Once you do that, completely restart Sublime, reconnect to your PHP server, and see if Chrome now works. You can also try the above code again.
Good luck!

Embedded Signing with Safari on Mac not working as intended

I successfully (with much frustration) got our c# embedded signing to work on our site, however, that was before I tested with Safari on a Mac. Safari does not allow Third party sites to open in an iframe without already having a cookie for that site stored. If you either open the site beforehand or allowing all cookies, the document will show embedded. However, even messing around with that, the redirection after completion is not working. The please wait popup does not redirect back to my site. I am looking for any embedded solution that supports mac.
The process works great on windows, but does not work on Safari for Mac and is intermittent with Firefox and Chrome on mac.
I am looking for any non-iFrame embedded solutions that I could implement that should work on all platforms and browsers.
Since you have embedding working in terms of generating a URL token, it's up to you how to access that URL. We've seen developers write their own programs to view where they have complete control over the iFrame and can do whatever they like with it, and another solution we've seen is to use a web browser control.
see this SO link
The only workaround that I know of is to pop up a new browser window. I know there is work being done to make it work without cookies, but at this time the new browser window is your only choice.
Sorry about that.

Sharepoint - Accessing PDF links via Chrome

Firstly let me state that I have zero experience with Sharepoint so this may be a pretty stupid question.
I started a new job yesterday and part of the induction is viewing the company literature via their Sharepoint portal. I've noticed that whenever I try to access an embedded PDF link via Chrome it seems like it's a broken link and appears to do a Google search instead. Yet when I try the exact same steps using IE all works as expected.
I don't want to raise this with my boss if it's going to make me look a little stupid! Is there some cross browser issue with PDF links?
Thanks.
Darren, try flushing the cache in Chrome, and if necessary, log off and log back into your computer. We've had the same problem with Chrome and Google doesn't seem to be fixing the problem (although they might point the finger back at Microsoft).
Yes I have the same issue with Chrome and Firefox
Sharepoint is optimized for IE and vice versa
You also can't open Files with the "Check in and Check out" functionality because only IE is able to do that from Sharepoint (Other Browsers will just Download the File)
You can try using AddOns like IE-Tab
(simply uses the IE algorithms within FF and Chrome for specific Sites)
But its better to use Sharepoint with IE

Resources