sideroad / grunt-selenium

Grunt plugin for Selenium Web Driver using html suite
MIT License
23 stars 5 forks source link

Command not supported (sendKeys, fireEvent etc) #13

Closed danhowitt closed 11 years ago

danhowitt commented 11 years ago

I'm having trouble running a test suite using grunt-selenium. I'm getting sendKeys not supported, as well as fireEvent in other tests.

Running "selenium:suite" (selenium) task
java -jar /Users/Dan/dev/numex/node_modules/grunt-selenium/tasks/lib/selenium-server-standalone-2.33.0.jar  -Dwebdriver.chrome.driver=/Users/Dan/dev/numex/node_modules/grunt-selenium/tasks/lib/mac.chromedriver
Setup browser [firefox]
  Running suite[test/e2e/TestSuite.suite]
>> Command not supported[sendKeys]
>> Command not supported[sendKeys]
>> Command not supported[]
    Running test case[exampleTestCase]
      open[http://google.com]
      click[id=gbqfb]
>> [assertText] was failed
>>         Element was not exists. [css=span]
    Finish  test case[exampleTestCase]
>> Error: Callback was already called.
Teardown browser [firefox]

Environment: Firefox 23.0.1 Selenium IDE 2.3.0 grunt-selenium ~0.4.15

Tests work perfectly in Selenium IDE.

Example test file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="https://www.google.co.uk/" />
<title>exampleTestCase</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">exampleTestCase</td></tr>
</thead><tbody>
<tr>
    <td>open</td>
    <td>http://google.com</td>
    <td></td>
</tr>
<tr>
    <td>sendKeys</td>
    <td>id=gbqfq</td>
    <td>hello world</td>
</tr>
<tr>
    <td>click</td>
    <td>id=gbqfb</td>
    <td></td>
</tr>
<tr>
    <td>waitForElementPresent</td>
    <td>link=Hello world program - Wikipedia, the free encyclopedia</td>
    <td></td>
</tr>
<tr>
    <td>clickAndWait</td>
    <td>link=Hello world program - Wikipedia, the free encyclopedia</td>
    <td></td>
</tr>
<tr>
    <td>sendKeys</td>
    <td>id=searchInput</td>
    <td>DNS</td>
</tr>
<tr>
    <td>clickAndWait</td>
    <td>id=searchButton</td>
    <td></td>
</tr>
<tr>
    <td>waitForElementPresent</td>
    <td>css=span</td>
    <td></td>
</tr>
<tr>
    <td>assertText</td>
    <td>css=span</td>
    <td>Domain Name System</td>
</tr>
<tr>
    <td></td>
    <td></td>
    <td></td>
</tr>

</tbody></table>
</body>
</html>
danhowitt commented 11 years ago

Massive thanks for this.