如何冒充用于自动Web测试Windows域用户? [英] how to impersonate a windows domain user for automated web testing?

查看:240
本文介绍了如何冒充用于自动Web测试Windows域用户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们即将建立与硒RC和Java客户端

we are about to build several UI test with selenium-rc and the java client

应用程序本身是使用集成安全从数据库中检索用户的权限,然后,根据这些权限的经典asp网络应用,显示一个菜单,此时,相应的选项。

the app itself is a classic asp web application that uses integrated security to retrieve the user's permissions from a database, and then, according to those permissions, displays a menu with the appropiate options.

我们希望这个测试自动化,像

we'd like to automate that test, something like

如果登录用户域/ user_test然后选项X shoulb启用
...

if the logged user is domain/user_test then optionx shoulb be enabled ...

是有一些方法以编程方式模拟一个域帐户,使selenimum-RC,在服务器上,可以跑与指定用户的浏览器吗?

is there some way to programatically impersonate a domain account, so that selenimum-rc, at the server, could "run" the browser with a specified user?

或者我应该围绕破解的方式,以便通过(例如)查询字符串传递用户应用?

or should I hack a way around so as to pass the user to the app by (for example) the querystring?

你如何处理这些类型的测试?

how do you handle these kind of tests?

非常感谢...

推荐答案

正在验证用户的权限基于一些抬头记录,并生成该用户的菜单。

You are validating a user's permissions based on some looked up record and producing a menu for that user.

下面似乎适合....

The following seems to fit....


  1. IIS有识别用户基于所述认证应用程序的作用。

  2. IIS要么识别用户为已知用户或未知用户。

  3. 如果IIS计算机是在域中,已知的用户将包括域和本地用户帐户。

从技术上讲,你的Web应用程序,有一个本地和域用户没有区别。 (除非有其它的细节没有提及)。你可以通过定义一个本地用户(或域用户)为每个测试用例和测试每个用户确认运行正常。这可能是更容易测试针对本地用户。

Technically, to your web app, there is no difference between a LOCAL and a DOMAIN user. (unless there are other details not mentioned). You could verify proper operation by defining a local user (or domain user) for each test case and testing each user. It might be easier to test against local users.

要确定用户,在转发URL您的凭据:

To Identify the user, forward your credentials in the url:

的http://用户名:密码@主机名/网站

请注意安全更新杀害在IE此功能为832894。
据MS:
默认情况下Windows的Internet Explorer版本的发布开始,在安全更新832894的发布不支持处理用户名和密码的HTTP和HTTP安全套接字层(SSL)或HTTPS URL。以下URL语法不支持在Internet Explorer或Windows资源管理器:
HTTP(S)://用户名:password@server/resource.ext

Please note that security updates have killed this functionality in IE as of 832894. According to MS: By default, versions of Windows Internet Explorer that were released starting with the release of security update 832894 do not support handling user names and passwords in HTTP and HTTP with Secure Sockets Layer (SSL) or HTTPS URLs. The following URL syntax is not supported in Internet Explorer or in Windows Explorer: http(s)://username:password@server/resource.ext

如果您结婚的IE浏览器,你可能要启动与RUNAS(如上所述)和设置autoauthentication。

If your are married to IE, you may have to initiate with RUNAS (as mentioned above) and set autoauthentication on.

如果您使用的是FF或OPERA你只要确定你配置IIS网站目录安全允许基本身份验证。

If you are using FF or OPERA you are OK as long as you configure the IIS website directory security to allow 'Basic authentication'.

这篇关于如何冒充用于自动Web测试Windows域用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆