0

I am working on writing Behat tests for an old bojankity system written in PHP. It seems to work for a number of test cases. However I am running into a strange problem.

I have Behat logging in and navigating to the search form page. Then it fills out the form by selecting a few drop-downs and filling in a text field. And then clicking the search button (keeping in mind that the button and some of the drop-downs have some JS actions attached to them). All of those actions pass, but on the next step after I run 'Then I press "Search"' I get the following error/message:

Then I wait five seconds                               # FeatureContext::iWaitFiveSeconds()
      Modal dialog present
      Build info: version: '2.32.0', revision: '6c40c18', time: '2013-04-09 17:22:56'
      System info: os.name: 'Linux', os.arch: 'i386', os.version: '3.5.0-31-generic', java.version: '1.6.0_43'
      Session ID: 13badfa6-9847-4db4-901f-fcfde797df92
      Driver info: org.openqa.selenium.firefox.FirefoxDriver
      Capabilities [{platform=LINUX, acceptSslCerts=true, javascriptEnabled=true, browserName=firefox, rotatable=false, locationContextEnabled=true, version=21.0, cssSelectorsEnabled=true, databaseEnabled=true, handlesAlerts=true, browserConnectionEnabled=true, nativeEvents=false, webStorageEnabled=true, applicationCacheEnabled=true, takesScreenshot=true}]

This is running through the Selenium 2 driver. The context function mentioned here is just a JS wait call. I use it and variations on it in several places. The same thing happens when I do other things at this point instead of waiting, such as checking for certain text on the page.

Any idea what might be going on? By the way, this is for an internal web app, so there are no URLs I can give out. I should also add that I am running this on Ubuntu 12.10 with PHP 5.3.

Thanks!

Patrick
  • 3,302
  • 4
  • 28
  • 47

1 Answers1

1

This could be caused due to an AJAX call messing with the flow of the test. make sure you give enough time for your AJAX requests to complete in the previous scenarios.

Best

FuzZ63
  • 90
  • 8