PHP-Formatter-PHPUnit_Selenium2 icon indicating copy to clipboard operation
PHP-Formatter-PHPUnit_Selenium2 copied to clipboard

statement is not a function

Open vladimirbasic opened this issue 11 years ago • 7 comments

Somehow, when I chain few steps in a row my output gives me some exceptions. Last 3 steps are changing username and clicking on submit button.

Firefox: 23.0.1 Os: Mac OS X 10.7.5 Selenium IDE: 2.3.0 PHP Formatter: https://github.com/suzuki/PHP-Formatter-PHPUnit_Selenium2

Output:

<?php

class Sel extends PHPUnit_Extensions_Selenium2TestCase
{
    /**
     * Setup
     */
    public function setUp()
    {
        $this->setBrowser('firefox');
        $this->setHost('127.0.0.1');
        $this->setPort(4444);
        $this->setBrowserUrl('http://test/');
    }

    /** 
     * Method testSel 
     * @test 
     */ 
    public function testSel()
    {
        $this->url("/user/add");
        $this->byId("submit")->click();
        $result = $this->byId("username-err")->text();
        $this->assertEquals("Username must consist of between 2 and 30 alphanumeric characters", $result);
        $result = $this->byId("firstName-err")->text();
        $this->assertEquals("First name must consist of between 2 and 30 alphanumeric characters", $result);
        // ERROR: Caught exception [TypeError: statement is not a function]
        // ERROR: Caught exception [TypeError: statement is not a function]
        // ERROR: Caught exception [TypeError: statement is not a function]
    }

}

vladimirbasic avatar Sep 16 '13 11:09 vladimirbasic

Hey guys,

is there any activity around here? I want to participate in this project. I want to put some more selenium commands into this formatter, but failing hard ;). i always get this

// ERROR: Caught exception [TypeError: statement is not a function]

The Commands from Selenium IDE HTML are

open / clickAndWait link=Sign on type id=email email@domain

If i get a hint i'll do all the work to integrate these and many more commands.

timruether avatar Dec 11 '13 15:12 timruether

Xubuntu 13.10 with Firefox 26.0, Selenium 2.4.0, PHP 5.5.3, PHPUnit 3.6.10

Seeing a similar issue when attempting to format:

<tr>
    <td>select</td>
    <td>id=edit-field-country-of-residence-value</td>
    <td>label=United States</td>
</tr>

PHP-Formatter-PHPUnit_Selenium2 outputs:

// ERROR: Caught exception [TypeError: value.replace is not a function]

If there's activity here, I'll help debug and test...

openprivacy avatar Dec 12 '13 16:12 openprivacy

Hey,

i did some work in my forked repo. Try https://github.com/timruether/PHP-Formatter-PHPUnit_Selenium2 and test your commands there. I use it in current projects ,so i'll investigate fast in issues with errors. My goal is it to cover the whole command set from IDE and translate it into Webdriver compatible code.

Thx for your work suzuki :)

Tim

timruether avatar Dec 12 '13 18:12 timruether

@timruether thanks to fork this !

I work hard to my job and other projects now, so I support this project in lower priorit. @vladimirbasic , @openprivacy , sorry reply is late.

suzuki avatar Dec 12 '13 23:12 suzuki

@timruether - thanks for the fork and the note. I added a comment referring to my note above on the handling of 'select'...

@suzuki - thanks for creating this project!

openprivacy avatar Dec 13 '13 18:12 openprivacy

I commited a new version in my fork with select please open issues there.

timruether avatar Dec 15 '13 00:12 timruether

You seem to have disabled issues in your repo after I created one...

webberig avatar Apr 17 '14 07:04 webberig