Python triggering / simulating Custom Browser Protocol - python

I want to make a python script that will automatically join zoom meeting at a specified time
when using browser you could use this url zoommtg://us02.zoom.us/join?action=join&confno=1234567890&pwd=Z1hTRjUwampocmR1VEh4aWkrSkZUdz09 to automatically join,
how do I trigger this Custom Browser Protocol directly in a python script without using a browser?
since a browser normally prompt you to www.example.com wants to open this application

Related

how to work on a exist session in selenium with python?

I want to fill some field of a webpage and then send a request to it
but this website has a very powerful login page to avoid sending requests for login from a robot
so I can't log in with selenium but after login, I can use selenium and I can send requests, on the other hand, I write this program for an app so I can't open a web driver and then work on it
I need to work on a tab that exists
I want to program work on a session that a human opened
From what I understand from your question is that you want to open an existing browser that is launched by a human.
There are multiple ways to achieve this and as mentioned by Devansh in the comment, You can use the session ID to get the already launched browser and execute your test script on it.
However, there is another way that might be able to solve your issue of executing scripts on already open connection or logged in user.
You can use the profiles of browsers for this scenario, User profiles in a browser are like user accounts on a computer.
You can use the answer to this question to create and use profiles in your script:
Opening an existing tab/logged in user using Chrome Webdriver
Now You can manually log in the required account for the website on the above profile you are struggling to log in and then launch the scripts.

How to keep log in credentials on Internet Explorer on Selenium

I'm currently working on a script that opens a URL and then click on buttons on a form in Internet Explorer specifically and repeat every x minutes. The problem I'm facing is that the website requires log-in credentials and it is not quite secure to hard code credentials inside the script.
The intention so far is to have Selenium open open a new tab inside an existing instance of IE that is already logged in. This would then allow the script to perform each time without having to enter credentials each time it runs.
How would I go about either doing the above and/or performing the same outcome (having selenium work on a IE instance with the log in credentials)

Make google calendar python API client use specific browser profile

Trying the code in the quick start guide here, I find the code tries to open a google URL using some firefox browser profile
https://developers.google.com/calendar/quickstart/python
If it needs to use a browser, I would like it to use a specific browser profile. How can I make it use that profile?
Alternatively, if I can prevent it from needing to use a browser at all, that would work too (I've already given it a credentials.json, but I guess I need some additional security credential to get access which can only be obtained using a real browser?).

How to automate Windows authentication in Python with selenium-rc?

I am using python to write selenium-rc test code for my server code. The server application is written with ASP.NET and is configured with "Windows authentication". The execution steps of my python code look like the following:
Start python main()
Create the selenium instance (say sel)
Start the selenium by calling sel.start()
Open the target URL with the selenium instance via calling sel.open(url)
Windows authentication dialog box pops up at this time
sel.open(url) is, by default, set to time out in 30 seconds while the authentication process is pending for input of username and password.
At this point, I could not find any way through selenium-rc interface to make it recognize the pop up dialog box. I google around and find out that the selenium-rc interface (in python) is for http authentication only- not Windows authentication.
I have tried to use autoit within selenium but still without luck.
Can any of you shed some light on this?
Thanks in advance.
marvinchen
Selenium has issues recognizing that window (try to search HTTP Basic Authentification for more details about it)
Basically, only thing which kinda works is to put username and password into URL request itself. Assuming your application runs on http://example.com the new url should look like this:
http://username:password#example.com
This solution works for me, but only using Google Chrome as a default browser for testing
There is now way you can sort it out easy and at this point unless I have missed something last few months it will only be FireFox who can fix this for you.
Read this blog how to sort it out:
http://applicationtestingtips.wordpress.com/2009/12/21/seleniumrc-handle-windows-authentication-firefox/

python web script send job to printer

Is it possible for my python web app to provide an option the for user to automatically send jobs to the locally connected printer? Or will the user always have to use the browser to manually print out everything.
If your Python webapp is running inside a browser on the client machine, I don't see any other way than manually for the user.
Some workarounds you might want to investigate:
if you web app is installed on the client machine, you will be able to connect directly to the printer, as you have access to the underlying OS system.
you could potentially create a plugin that can be installed on the browser that does this for him, but I have no clue as how this works technically.
what is it that you want to print ? You could generate a pdf that contains everything that the user needs to print, in one go ?
You can serve to the user's browser a webpage that includes the necessary Javascript code to perform the printing if the user clicks to request it, as shown for example here (a pretty dated article, but the key idea of using Javascript to call window.print has not changed, and the article has some useful suggestions, e.g. on making a printer-friendly page; you can locate lots of other articles mentioning window.print with a web search, if you wish).
Calling window.print (from the Javascript part of the page that your Python server-side code will serve) will actually (in all browsers/OSs I know) bring up a print dialog, so the user gets system-appropriate options (picking a printer if he has several, maybe saving as PDF instead of doing an actual print if his system supports that, etc, etc).

Categories

Resources