rnixik/selenium2php

MigrationToSelenium2

Closed this issue · 9 comments

How does this work? I used your converter from HTML and that worked fine. I'm having a hard time understanding this on.

Thanks

Bruce

MigrationToSelenium2 - is an experiment. I thought I can use my Selenium1 Test Cases with Selenium2 WebDriver. This class MigrationToSelenium2 is adapter. But tests didn't work in that form without changing. Later I updated selenium2php for Selenium2 support.

Thank you for your reply. Are you aware of a good wait for Selenium2RestCase?

Bruce

On Nov 7, 2013, at 17:36, rnixik notifications@github.com wrote:

MigrationToSelenium2 - is an experiment. I thought I can use my Selenium1 Test Cases with Selenium2 WebDriver. This class MigrationToSelenium2 is adapter. But tests didn't work in that form without changing. Later I updated selenium2php for Selenium2 support.


Reply to this email directly or view it on GitHub.

What's wrong with waitUntil()?

I’m not sure of the application.
This is how it is now and there doesn’t seem to be any wait.

setBrowser("safari"); $this->setBrowserUrl("http://www.mortgagecalculator.org/"); } function testMcf(){ $this->url('/'); ``` //$this->windowMaximize("", ""); //$this->windowFocus("", ""); $input = $this->byName("param[homevalue]"); $input->clear(); $input->value(""); $input = $this->byName("param[homevalue]"); $input->value("520000"); $element = $this->byName("param[credit]"); $selectElement = $this->select($element); $selectElement->selectOptionByLabel("Excellent"); $input = $this->byName("param[principal]"); $input->clear(); $input->value(""); $input = $this->byName("param[principal]"); $input->value("366000"); $element = $this->byName("param[rp]"); $selectElement = $this->select($element); $selectElement->selectOptionByLabel("Refinance"); $input = $this->byName("param[interest_rate]"); $input->clear(); $input->value(""); $input = $this->byName("param[interest_rate]"); $input->value("3.5"); $input = $this->byName("param[term]"); $input->clear(); $input->value(""); $input = $this->byName("param[term]"); $input->value("30"); $element = $this->byName("param[start_month]"); $selectElement = $this->select($element); $selectElement->selectOptionByLabel("Sep"); $element = $this->byName("param[start_year]"); $selectElement = $this->select($element); $selectElement->selectOptionByLabel("2013"); $input = $this->byName("param[property_tax]"); $input->clear(); $input->value(""); $input = $this->byName("param[property_tax]"); $input->value("2"); $input = $this->byName("param[pmi]"); $input->clear(); $input->value(""); $input = $this->byName("param[pmi]"); $input->value("0"); $this->waitUntil(function($testCase) { try { $testCase->byCssSelector("input[type=\"submit\"]"); return true; } catch (PHPUnit_Extensions_Selenium2TestCase_WebDriverException $e) {} }, 8000); $input = $this->byCssSelector("input[type=\"submit\"]"); $input->click(); $input = $this->byCssSelector("h2"); $this->assertEquals("Mortgage Repayment Summary", $input->text()); $input = $this->byCssSelector("td > h3"); $this->assertEquals("$2,610.17", $input->text()); //$this->close("", ""); ``` } } Also with this test and using fire fox everything works OK, but with safari it doesn’t seem like the “click” is taking place. Are you aware of anything with safari? It works in selenium IDE web driver using safari. I appreciate your help. Where are you located? Bruce On Nov 7, 2013, at 6:25 PM, rnixik notifications@github.com wrote: > What's wrong with waitUntil()? > > — > Reply to this email directly or view it on GitHub.

Hm, I didn't work with Safari. But test works in PhantomJs (except last assert). May be something wrong with Safari WebDriver.

OK. Again, thanks for your help. That converter works great. Are you in the U.S?
On Nov 7, 2013, at 6:57 PM, rnixik notifications@github.com wrote:

Hm, I didn't work with Safari. But test works in PhantomJs (except last assert). May be something wrong with Safari WebDriver.


Reply to this email directly or view it on GitHub.

No problem. I'm in Russia.

Do svidania. My wife grew up in Poland in the 60’s so she knows the Russki.
On Nov 7, 2013, at 7:02 PM, rnixik notifications@github.com wrote:

No problem. I'm in Russia.


Reply to this email directly or view it on GitHub.

Bye :)