会话[url]不可用,也不在最近的1000个终止的会话中.怎么解决呢? [英] Session [url] not available and is not among the last 1000 terminated sessions. How to solve this?
问题描述
当我尝试启动
php behat.phar
php behat.phar
会弹出WebDriver firefox窗口,然后我的功能测试第一步失败,并跳过其余部分.我得到:
The WebDriver firefox window pops up and then my feature test fails at first step and skips the rest. I get:
...
...
鉴于我在"first.php"上#FeatureContext :: visit()
Given I am on "first.php" #FeatureContext::visit()
会话[url]不可用,不在最近的1000个终止的会话中.
Session [url] not available and is not among the last 1000 terminated sessions.
活动会话是[ext.键51191ae0-8f6f-49d0-27b322967296]
Active sessions are[ext. key 51191ae0-8f6f-49d0-27b322967296]
...
如果我只使用behat,则测试通过.仅当我尝试使用硒时才会发生这种情况.
If I only use behat the test passes. This happens only when I try to use selenium.
我正在使用MinkExtension GivenIAmOn()预制函数
I'm using MinkExtension GivenIAmOn() premade function
我的behat.yml:
my behat.yml:
default:
paths:
features: features
bootstrap: features/bootstrap
extensions:
mink_extension.phar:
mink_loader: 'mink.phar'
base_url: 'http://10.0.0.10/'
goutte: ~
selenium2:
wd_host: 'http://localhost:4444/wd/hub'
capabilities:
version: ''
我的FeatureContext从MinkContext扩展而来. 我一直在寻找解决方案好几天了,但我解决不了.
My FeatureContext extends from MinkContext. I've been searching for a solution for days and I couldn't solve this.
我正在使用带Firefox 26,selenium-server-standalone-2.42.2的Windows 7,并且我也尝试了较低的版本.当我读到一些问题时,session/"session-id"/url在某些版本之前已被破坏,但现在不应该了.由于某些原因,它无法选择正确的会话.
I'm working with Windows 7 with firefox 26, selenium-server-standalone-2.42.2 and I tried lower versions as well. As I read in some issues, the session/"session-id"/url was broken some versions ago, but now it shouldn't. For some reason it can't pick the right session.
对不起,数据质量,我的工作场所没有互联网连接,而且非常有限.这就是为什么我使用.phar文件而不使用composer的原因.我不能复制粘贴文件等等.如果我需要提供更多数据,请告诉我,我会的.
Sorry for the data quality, I don't have an internet connection at my workplace and it's quite restricted. That's why I use .phar files instead of using composer. I can't either copy-paste the files and so on. If I have to provide more data just tell me and I will.
推荐答案
听起来像 grid级超时问题.您应该尝试增加browserTimeout
和newSessionWaitTimeout
并查看是否有帮助.
It sounds like a grid-level timeout issue. You should try to increase browserTimeout
and newSessionWaitTimeout
and see if that helps.
网格中的超时通常应通过
webDriver.manage().timeouts()
处理,这将控制不同操作的超时方式.
Timeouts in the grid should normally be handled through
webDriver.manage().timeouts()
, which will control how the different operations time out.
browserTimeout应该是:
The browserTimeout should be:
- 高于套接字锁定超时(45秒).
- 通常高于
webDriver.manage().timeouts()
中使用的值,因为该机制是最后一道防线".
- Higher than the socket lock timeout (45 seconds).
- Generally higher than values used in
webDriver.manage().timeouts()
, since this mechanism is a "last line of defense".
对于任何问题,还请检查: http://localhost:4444/wd/hub/sessions
For any issues, check also: http://localhost:4444/wd/hub/sessions
这篇关于会话[url]不可用,也不在最近的1000个终止的会话中.怎么解决呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!