FuckTheWorld / chromedriver

Automatically exported from code.google.com/p/chromedriver
0 stars 0 forks source link

Commands goBack and goForward have race condition. #653

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
========== 
org.openqa.selenium.PageLoadingTest.testShouldBeAbleToNavigateBackInTheBrowserHi
storyInPresenceOfIframes (0.328s)
junit.framework.AssertionFailedError: 
Expected: "XHTML Test Page"
     but: was "http://localhost:15979/common/xhtmlTest.html"
    at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
    at org.openqa.selenium.PageLoadingTest.testShouldBeAbleToNavigateBackInTheBrowserHistoryInPresenceOfIframes(PageLoadingTest.java:165)
    at org.openqa.selenium.testing.SeleniumTestRunner$2.evaluate(SeleniumTestRunner.java:107)
    at org.openqa.selenium.testing.SeleniumTestRunner.runChild(SeleniumTestRunner.java:80)
    at org.openqa.selenium.testing.ParallelSuite$2.run(ParallelSuite.java:40)
    at org.openqa.selenium.testing.ParallelSuite$ThreadPool$1.run(ParallelSuite.java:79)

@@@STEP_TEXT@PageLoadingTest.testShouldBeAbleToNavigateBackInTheBrowserHistoryIn
PresenceOfIframes@@@
Rerun failing tests with filter: 
PageLoadingTest.testShouldBeAbleToNavigateBackInTheBrowserHistoryInPresenceOfIfr
ames

It can be reproduced with ~10 runs.

python chrome/test/chromedriver/test/run_java_tests.py 
--chromedriver=out/Release/chromedriver.exe -chrome=/path/to/chrome_32.exe 
-filter=PageLoadingTest.testShouldBeAbleToNavigateBackInTheBrowserHistoryInPrese
nceOfIframes --chrome-version=32

Original issue reported on code.google.com by st...@chromium.org on 10 Dec 2013 at 12:33

GoogleCodeExporter commented 9 years ago
For command getTitle, we return document.title if it is not null or empty. 
Otherwise, we return document.URL.

Thus, there might be a race in this case.
"http://localhost:15979/common/xhtmlTest.html" is the url, while "XHTML Test 
Page" is the expected title.

Original comment by st...@chromium.org on 10 Dec 2013 at 12:42

GoogleCodeExporter commented 9 years ago
========== 
org.openqa.selenium.PageLoadingTest.testShouldBeAbleToNavigateBackInTheBrowserHi
story (0.275s)
junit.framework.AssertionFailedError: 
Expected: "We Leave From Here"
     but: was "http://localhost:7103/common/formPage.html"
    at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
    at org.openqa.selenium.PageLoadingTest.testShouldBeAbleToNavigateBackInTheBrowserHistory(PageLoadingTest.java:150)
    at org.openqa.selenium.testing.SeleniumTestRunner$2.evaluate(SeleniumTestRunner.java:107)
    at org.openqa.selenium.testing.SeleniumTestRunner.runChild(SeleniumTestRunner.java:80)
    at org.openqa.selenium.testing.ParallelSuite$2.run(ParallelSuite.java:40)
    at org.openqa.selenium.testing.ParallelSuite$ThreadPool$1.run(ParallelSuite.java:79)

Original comment by st...@chromium.org on 10 Dec 2013 at 1:25

GoogleCodeExporter commented 9 years ago

Original comment by st...@chromium.org on 10 Dec 2013 at 1:25

GoogleCodeExporter commented 9 years ago
Also fail in chrome 31.

Original comment by st...@chromium.org on 10 Dec 2013 at 3:24

GoogleCodeExporter commented 9 years ago
PageLoadingTest.testShouldBeAbleToNavigateBackInTheBrowserHistory also fails on 
Mac.

http://build.chromium.org/p/chromium.chromedriver/builders/Mac%2010.6/builds/263
0/steps/java_tests%28v239795%29/logs/stdio

Original comment by st...@chromium.org on 10 Dec 2013 at 7:19

GoogleCodeExporter commented 9 years ago
goBack is more obvious for Win7 and Mac.

Original comment by st...@chromium.org on 11 Dec 2013 at 2:27

GoogleCodeExporter commented 9 years ago
Issue 227 has been merged into this issue.

Original comment by st...@chromium.org on 11 Dec 2013 at 2:28

GoogleCodeExporter commented 9 years ago
Maybe Page.navigateToHistoryEntry could help resolve the race.
Worth a check.

Original comment by st...@chromium.org on 28 Jan 2014 at 7:08

GoogleCodeExporter commented 9 years ago
Issue 528 has been merged into this issue.

Original comment by st...@chromium.org on 28 Jan 2014 at 7:11

GoogleCodeExporter commented 9 years ago
The GoBack and GoForward commands have been reimplemented using 
Page.navigateToHistoryEntry, and these tests are no longer flaky, so I've 
reenabled them in crrev.com/786163003.

Original comment by samu...@chromium.org on 9 Dec 2014 at 4:41

GoogleCodeExporter commented 9 years ago
These tests are still causing problems, so the change in #10 was reverted in 
crrev.com/786163003.

Original comment by samu...@chromium.org on 12 Dec 2014 at 10:06

GoogleCodeExporter commented 9 years ago

Original comment by samu...@chromium.org on 21 Feb 2015 at 12:19

GoogleCodeExporter commented 9 years ago
Unable to reproduce issue with chromedriver:2.15. Please try with latest 
version and let us know if you are still facing the issue.

Sample Code:
//testShouldBeAbleToNavigateBackInTheBrowserHistoryInPresenceOfIframes
        System.setProperty("webdriver.chrome.driver",Utility.getPath("drivers/chromedriver.exe"));
        WebDriver driver = new ChromeDriver();
        driver.get("file://C:\\Java\\html\\653\\xhtmlTest.html");
        driver.findElement(By.name("sameWindow")).click();
        Assert.assertEquals(driver.getTitle(), "This page has iframes");
        driver.navigate().back();
        Assert.assertEquals(driver.getTitle(), "XHTML Test Page");

        //testShouldBeAbleToNavigateBackInTheBrowserHistory 
        System.setProperty("webdriver.chrome.driver",Utility.getPath("drivers/chromedriver.exe"));
        WebDriver driver = new ChromeDriver();
        driver.get("file://C:\\Java\\html\\653\\formPage.html");
        driver.findElement(By.id("imageButton")).click();
        Assert.assertEquals(driver.getTitle(), "We Arrive Here");
        driver.navigate().back();
        Assert.assertEquals(driver.getTitle(), "We Leave From Here");

Original comment by ssudunag...@chromium.org on 10 Jun 2015 at 10:46