selenium 3 firefox使用错误的媒体查询

时间:2018-04-23 08:12:11

标签: java selenium firefox testing geckodriver

我们正在将我们的测试工具从Selenium 2.53升级到最新的(3.11.0)Selenium和Selenium-grid-3。我们使用Jenkins在Chrome和Firefox上的奴隶机器上通过网格运行场景。 Geckodriver for Firefox不支持Firefox V< = 47,因此我们必须将Mozilla浏览器升级到最新版本(59.0.2)。

在Chrome上运行测试用例很好。另一方面,在Firefox上运行测试用例绝对不行。

问题是Firefox以某种方式使用不同的媒体查询,这意味着某些元素在页面上不可见,因此Selenium例如无法点击它(浏览器分辨率为fullHD但使用@media屏幕和(max-width:每次750px)。

我们在Selenium 2.53和Firefox 47.0.2上测试了相同的测试用例,这很好,一切都很顺利(正如我提到的那样,Chrome也没关系。)

有人知道这个问题的解决方案吗?谢谢

更新:

这是小黄瓜:

When I open Irista
Then Irista 'Homepage' is loaded

When I sign in to irista with 'xxx' username and 'xxx' password
Then Irista 'Timeline' is loaded

When I open the hosturl with custom ending '/fivehundred'
Then the 'error_500_page' is loaded
And the 'irista main logo' element is 'visible'

当它检查主徽标的可见性时,它会失败,因为在750px宽度上,徽标的显示为无。

您可以在此处看到屏幕左上角带有徽标的页面: Page with logo

没有徽标的页面: Page without logo

正如您所看到的,它使用宽度:750px查询 Page without logo with settings

问题:

    org.openqa.selenium.TimeoutException: Expected condition failed: waiting for com.oce.common.autotest.util.PageUtilBy$$Lambda$129/649053158@7969e045 (tried for 20 second(s) with 500 MILLISECONDS interval) Build info: version: '3.9.1', revision: '63f7b50', time: '2018-02-07T22:25:02.294Z' System info: host: 'OSZ-WS00044', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.13.0-38-generic', java.version: '1.8.0_151' 
Driver info: org.jbehave.web.selenium.RemoteWebDriverProvider$ScreenshootingRemoteWebDriver Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 58.0.2, javascriptEnabled: true, moz:accessibilityChecks: false, moz:headless: false, moz:processID: 15628, moz:profile: C:\Users\osz-brtest01\AppDa..., moz:webdriverClick: true, pageLoadStrategy: normal, platform: XP, platformName: XP, platformVersion: 10.0, rotatable: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, webdriver.remote.sessionid: 9ed1c654-d052-4a5b-b557-14a...} Session ID: 9ed1c654-d052-4a5b-b557-14a737f7216d

0 个答案:

没有答案