我正在寻找一种将 Selenium 与摘要式身份验证结合使用的好方法(对于灵活的 UI,尽管我认为如果我无法进行身份验证,这不会产生任何影响)。我想避免平台依赖性,例如使用 AutoIT 来驱动浏览器弹出窗口(因为跨平台测试是使用 Selenium 的动力),但如果有一个好的跨平台库可以做这样的事情,那就行了美好的。
我在想也许有一种方法可以使用单独的 http 客户端创建会话,然后将会话凭据传递给浏览器,但我不确定如何将会话 ID 注入到浏览器请求中。这只是我的一个想法,不知道可行性如何。
I am looking for a good way to use Selenium with Digest Authentication (for a flex UI though I don't think that makes a difference if I can't do authentication). I'd like to avoid platform-dependencies such as using AutoIT to drive browser pop-ups (since cross-platform testing is a motivator for going to Selenium), though if there's a good cross-platform library for doing such things that would work fine.
I'm thinking maybe there is a way to use a separate http client to create a session and then pass the session credentials off to the browser, but I'm not sure how to inject the session ID into the browser requests. That's just an idea I had, not sure how feasible it is.
发布评论
评论(2)
您可以尝试使用 HTTP 代理,例如 AuthProxy .com/users/281199/carl-youngblood">@CarlYoungblood。
它是一个用 Ruby 编写的 HTTP 代理服务器,专门用于测试需要使用 Selenium 进行基本身份验证的服务器,但它也应该适用于具有摘要身份验证的服务器。
You could try using an HTTP proxy, such as AuthProxy by @CarlYoungblood.
It's an HTTP proxy server written in Ruby which was developed specifically for testing a server that required basic authentication with Selenium, but it should also work on a server with digest authentication.
简单地解释一下,您无法从 Selenium 自动化 Flex UI,因为它不处理 Flash 进行测试(您可以在浏览器中嵌入 flash 插件,但 Selenium 将无法针对 flash 组件进行测试...)
即使您可以进行身份验证,您也无法测试任何内容,因此,您应该尝试其他方法,例如 Sikuli
Simply explained, you cannot automate a Flex UI from Selenium, as it doesn't handle Flash for testing (you can embed the flash plugin in your browser, but Selenium won't be able to test against flash component...)
Even if you can authenticate, you won't be able to test anything, so, you should try something else, like Sikuli