Authenticating dialog box in Linux environment using Selenium - linux

The Base URL in my Web Driver class asks for authentication for username and password. My Scripts run perfectly on Windows environment using AutoIT for authentication using the below mentioned code line.
`System.setProperty("webdriver.chrome.driver", this.getClass().getClassLoader().getResource("data/chromedriver_win32.exe").getFile());`
But I need to run on Linux environment and I want to replace this server authentication in place of AutoIT.
I have googled it and I got the results that I can still run the scripts using wine but the results are not perfect. If anyone found solution for this kind of problem please help me.
Thanks

This may not be a secure approach, but would it help to put user name & password in the URL?
I mention it is not a secure way since it is for an automated test and you'd have to take safeguards to ensure who the viewing audience is, since you don't want security risks.
If your application typically challenges with htpassword box, you might want to see
http://community.sitepoint.com/t/sending-htpasswd-login-information-in-a-url/2586/2

Related

How to run Chrome as a different user

I'm running the automation test using Atata framework in a domain network which automatically detects the current user using Windows Authentication so we kind of facing the issue not be able to use a different user for our test. Therefore, I wonder is there a way to run Chrome as a different user?
Thank you in advance for your help.
Kind regards,
Son
I've just started learning test automation, but it works for me to set base url in format DOMAIN%5CUSERNAME:PASSWORD#ADDRESS
AtataContext.Configure().
UseChrome().
WithArguments("start-maximized").
WithLocalDriverPath().
UseBaseUrl("https://DOMAIN%5CUSERNAME:PASSWORD#ADDRESS").
UseNUnitTestName().
AddNUnitTestContextLogging().
AddScreenshotFileSaving().
LogNUnitError().
TakeScreenshotOnNUnitError().
Build();

How to recover from "No authentication methods configured" on login page

While trying to get GitLab Kanban Board to run nicely with my GitLab server I somehow managed to get myself locked out of the latter. Whenever I open the GitLab-URL now there's the message "No authentication methods configured" and no option for logging in.
Unfortunately, I don't even remember the exact settings that I was messing around with at that time, because it was a while ago and it's only now that I found the time for dealing with this problem again. IIRC one of the last things I did was to try and get OAuth working. (And I think that I was changing some settings in the web interface last, not in the settings files.)
Unable to find a solution online, one of the things I tried was to do a backup and then restore that on a different server. But the result is that I then get the same message on the new server also.
Does anyone have any idea on how to recover from this situation? Is there any way for example to enable "normal" login again by changing settings in the database?
If it's not (easily) possible to recover the whole GitLab installation, is there some way to somehow at least extract the bug report data from it? That's the data that I would be most unhappy to loose...
I'd really appreciate any help, because I'm completely at a loss right now!
You can use the Rails console to reenable your sign-in.
sudo gitlab-rails console
s = ApplicationSetting.find_by(signin_enabled: false)
s.signin_enabled = true
s.save
This will modify the rails settings directly.
As of version 10.5.X, use this instead (different ApplicationSetting key)
sudo gitlab-rails console
s = ApplicationSetting.find_by(password_authentication_enabled_for_web: false)
s.password_authentication_enabled_for_web = true
s.save

how to configure windows change password policy on linux

I work in a linux system with a windows proxy account. The password must change aways at the end of the month. Nowdays i need to go to a windows machine, change my password and go back to my linux machine.
The password is used for others internal services too. (like private email, git access, database access, etc).
I want to change my password without the help of a windows. I want to do it on linux. It can be done?
This is really the wrong forum: I'd suggest trying serverfault.com.
SUGGESTION:
It sounds like smbpasswd might be a solution: http://serverfault.com.

Opening a website automatically using secure code

I want to open a website(say www.google.com) automatically whenever I am logon. This can be achieved through batch script and VBA macros but it can not be implemented on organisational level due to security concerns.
Is there any secure way to open a particular website using some piece of code.
Please let me know. Thanks in advance.
Regards,
Shrikant Salunke
There are lots of ways to do this, but I'm not sure exactly when you mean by "whenever I am logon".
Basically, if you want the most portable, multilingual way to open a web page with a program you are going to be passing a shell command that looks like this (following your example)
open https://www.google.com
This will open the specified URL (I think it must be a complete URL - including scheme) on the default browser.
Now the "when I am logon" part is what could make things complicated.
If by "when I am logon" you mean whenever you open your browser, then you don't even need to do this you can just reset your browser's homepage.
If you mean whenever you logon to your proxy, you just have to make sure that the first proxy request you send contains the correct request URI. In the case of google the correct URI would be google.com:443. The URI will have the format <hostname>:<portnumber>. The default HTTPS port number is 443. The default HTTP port number is 80.
If you mean whenever you logon to your system then you just need to execute the command open https://www.google.com within a login shell script. Login scripts are system dependent but you may refer to this post if you use a Unix-like or Posix compliant OS. If you use Windows I don't know how to help you but I'm sure there's a way to do it.
If you mean whenever you log into some program you wrote then things get really easy. You just have to make a call to that open command. Almost every language has a built in method for interacting with a shell. You just have to find that method in whatever platform you're using.
I honestly don't know if this will be helpful but good luck!
Edit
How to Run a Batch Shell Script Securely
What you need to do is run the script with a different trustlevel. Since you're using Batch you can do this by executing your script using the runas command (docs). This command allows you to adjust the trustlevel under which the script is executed without changing users. By changing the privileges of the executable, you can prevent it doing anything malicious. All it needs is enough "trust" to execute the open command.
If you need this fully automated throughout your organization, you can wrap your Batch file in a second Batch file that will call the runas command. This wrapper script will not run with reduced privileges but it also won't interact with the internet so you don't have to worry about it as much. You would be able to execute the wrapper script as a login script, and then everything should work.
Honestly I'm not a Windows person but I hope this helps!

ColdFusion Admin Login and Password recovery

I recently took over the development of a CF site and am having some trouble obtaining the login and password to the Admin for CF. I was hoping another StackOverflower may haave some insight on obtaining access. We have access to the FTP and any other hosting related details. Any helpful insight will be greatly appreciated.
Open up the password.properties file which lies in <coldfusion install directory>\lib
You can see some encrypted string like
password=5BAA61E4C9B93F3F0682250B6CF8331B7EE68FD8
encrypted=true
Change it to clear text with encrypted=false
password=newPassword
encrypted=false
After that you can log in using newPassword and reset to a proper password in the CF Administrator.
http://coldfusion8.blogspot.com/2008/08/what-if-you-forget-coldfusion-admin.html
I believe this also works for 6, 7,m and 9.
Building on what Ben said Simon Whatley has a great article outlining several different ways to accomplish this: http://www.simonwhatley.co.uk/resetting-a-lost-coldfusion-password really good stuff.
If you are running Coldfusion on a Mac or Linux all you need to do is:
On the terminal go to the bin directory of Coldfusion application
There is a password reset script: passwordreset.sh
running the script will ask you for a new password
Stop and Restart Coldfusion
I was going to suggest using the admin API to see if you could reset the password or even make a .car backup of the server settings in the event of a re-install.
http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=basiconfig_37.html
For earlier versions, you can change a registry key, see details here : http://www.tek-tips.com/faqs.cfm?fid=3731

Resources