Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- I am using selenium-html-js-converter to convert a seleniumIDE test case into nodeJS, the conversion works without error but I get this error when I try to run the output. I have tried a couple of versions of node and a couple of different tests but always get the same result.
- ../node-v6.11.3-linux-x64/bin/node ./run.js
- /home/james/node_modules/make-sync/node_modules/fibers/future.js:280
- throw(ex);
- ^
- Error: Failure in Selenium command "type("id=uh-search-box", "selenium")": [elementById("uh-search-box")] Not JSON response (Screenshot was saved to screenshots/test_outfile/Exception@type.png)
- at exports.newError (/home/james/node_modules/wd/lib/utils.js:139:13)
- at /home/james/node_modules/wd/lib/callbacks.js:56:17
- at /home/james/node_modules/wd/lib/webdriver.js:169:5
- at Request._callback (/home/james/node_modules/wd/lib/http-utils.js:78:7)
- at Request.self.callback (/home/james/node_modules/wd/node_modules/request/request.js:121:22)
- at emitTwo (events.js:106:13)
- at Request.emit (events.js:191:7)
- at Request.<anonymous> (/home/james/node_modules/wd/node_modules/request/request.js:985:14)
- at emitOne (events.js:101:20)
- at Request.emit (events.js:188:7)
- at IncomingMessage.<anonymous> (/home/james/node_modules/wd/node_modules/request/request.js:936:12)
- at emitNone (events.js:91:20)
- at IncomingMessage.emit (events.js:185:7)
- at endReadableNT (_stream_readable.js:974:12)
- at _combinedTickCallback (internal/process/next_tick.js:80:11)
- at process._tickCallback (internal/process/next_tick.js:104:9)
- Here is the convert script, yep its just two lines.
- var converter = require("selenium-html-js-converter");
- converter.convertHtmlFileToJsFile("./test.sel", "./outfile");
- Here is the run script(run.js) which I use to run the output from the converter(outfile)
- var wdSync = require('wd-sync');
- var client = wdSync.remote('127.0.0.1', 8910); // phantomjs default wd port
- var browser = client.browser;
- var sync = client.sync;
- var test1 = require('./outfile');
- sync(function(){
- browser.init({ browserName: 'phantomjs' });
- test1(browser);
- browser.quit();
- });
- here is the contents of the selenium IDE test case (test.sel)
- <?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="http://search.emory.edu/search?btnG=Search&entqr=0&output=xml_no_dtd&ud=1&client=monitoring&oe=UTF-8&ie=UTF-8&proxystylesheet=monitoring&site=default_collection&numgm=5" />
- <title>search</title>
- </head>
- <body>
- <table cellpadding="1" cellspacing="1" border="1">
- <thead>
- <tr><td rowspan="1" colspan="3">search</td></tr>
- </thead><tbody>
- <tr>
- <td>open</td>
- <td>/search?btnG=Search&entqr=0&output=xml_no_dtd&ud=1&client=monitoring&oe=UTF-8&ie=UTF-8&proxystylesheet=monitoring&site=default_collection&numgm=5</td>
- <td></td>
- </tr>
- <tr>
- <td>type</td>
- <td>name=q</td>
- <td>human resources</td>
- </tr>
- <tr>
- <td>clickAndWait</td>
- <td>name=btnG</td>
- <td></td>
- </tr>
- <tr>
- <td>verifyTitle</td>
- <td>Search Results: human resources</td>
- <td></td>
- </tr>
- </tbody></table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement