简体   繁体   English

使用Selenium在Linux环境中验证对话框

[英]Authenticating dialog box in Linux environment using Selenium

The Base URL in my Web Driver class asks for authentication for username and password. Web驱动程序类中的基本URL要求用户名和密码进行身份验证。 My Scripts run perfectly on Windows environment using AutoIT for authentication using the below mentioned code line. 我的脚本使用以下提到的代码行在Windows环境下使用AutoIT进行身份验证可以完美运行。

    `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. 但是我需要在Linux环境上运行,并且我想替换此服务器身份验证来代替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. 我已经用谷歌搜索了,结果是我仍然可以使用wine运行脚本,但是结果并不完美。 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? 这可能不是一种安全的方法,但是将用户名和密码放在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 如果您的应用程序通常会遇到htpassword框的挑战,则可能需要查看http://community.sitepoint.com/t/sending-htpasswd-login-information-in-a-url/2586/2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM