Sep-12-2018, 10:47 AM
Hello,
I am using many environments of an application in my work. Each environment has a different URL.
I am using the webbrowser module to quickly open the app in a particular environment from the windows CMD. See the code below.
Now I want to go further and once the application is open in a browser then to log in automatically.
I found that I could use selenium to automatically log in.
The point is that my application is working in IE 11 only and selenium seems to be not working with IE 11. I had to make some entries to the registry but still getting errors.
My question is how to log in to the web app not using selenium?
I am using many environments of an application in my work. Each environment has a different URL.
I am using the webbrowser module to quickly open the app in a particular environment from the windows CMD. See the code below.
Now I want to go further and once the application is open in a browser then to log in automatically.
I found that I could use selenium to automatically log in.
The point is that my application is working in IE 11 only and selenium seems to be not working with IE 11. I had to make some entries to the registry but still getting errors.
My question is how to log in to the web app not using selenium?
import webbrowser, sys url = 'google.com' if len(sys.argv) > 1: arg = str(sys.argv[1]).upper() else: arg = "" prod='https://produrl' uat='https://uat' sit='http://sit' dev='http://dev' reftest='http://reftest' refqa='http://refqa' refdev='http://dev' if arg == 'PROD': url = prod elif arg == 'UAT': url = uat elif arg == 'SIT': url = sit elif arg == 'DEV': url = dev elif arg == 'REFTEST': url = reftest elif arg == 'REFQA': url = refqa elif arg == 'REFDEV': url = refdev else: if arg: url = 'unknown' else: url = 'none' if url == 'none': print ('W parametrze musisz podać nazwę środowiska...') elif url == 'unknown': print ('Nie znam takiego środowiska...%s' %(arg)) else: webbrowser.get(webbrowser.iexplore).open_new_tab(url) print ('Otwieram...%s' %(arg))