getValue throws an exception always

412 views
Skip to first unread message

Zizeke

unread,
Jun 28, 2014, 1:10:26 PM6/28/14
to nightw...@googlegroups.com
Hello,

I'm moving to nightwatchjs from webdriversio and having huge issues with it.

browser
.waitForElementVisible( 'body', 1000 )
.setValue( 'select#curr1', 'euro' )
.setValue( 'select#curr2', 'huf' )
.setValue( 'input#value1', '100' )
.getValue("input#value2", function(result) {
console.log( '>>>>>>>>>', result );
})
.assert.value( 'input#value2', 30200 )
.end();

The function getValue throws an exception:

error: 'An unknown server-side error occurred while processing the command.' }

Nothing on selenium-side, no warning or error.
Any idea would be much appreciated.

Zizeke

unread,
Jun 28, 2014, 1:12:26 PM6/28/14
to nightw...@googlegroups.com
nightwatch is the latest, selenium is selenium-server-standalone-2.42.2.jar, node is 0.11.13, Yosemite os.

David Linse

unread,
Jun 28, 2014, 3:22:57 PM6/28/14
to nightw...@googlegroups.com
Could you provide a reproducable test, maybe against _nightwatchjs.org_ ?
~david


On Sat, Jun 28, 2014 at 7:12 PM, Zizeke <imre.f...@gmail.com> wrote:
nightwatch is the latest, selenium is selenium-server-standalone-2.42.2.jar, node is 0.11.13, Yosemite os.

--
You received this message because you are subscribed to the Google Groups "NightwatchJs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nightwatchjs...@googlegroups.com.
To post to this group, send email to nightw...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nightwatchjs/b23b5fb4-2984-410f-ad64-210324895e3b%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Zizeke

unread,
Jun 28, 2014, 4:15:52 PM6/28/14
to nightw...@googlegroups.com
Yep, sure. 
This is what I used now:


module.exports = {
"test": function( browser ){
  return browser
.waitForElementVisible( 'body', 1000 )
.getValue(".sample-test", function(result) {
console.log( '>>>>>>>>>', result );
})
.end();
}
};

Querying a field from the page of nightwatchJS, running this with the following config:

{
"src_folders": [ "test/nightwatch/tests" ],
"output_folder" : "test/nightwatch/reports",
"selenium" : {
"start_process" : false,
"server_path" : "/Dev/selenium/selenium-server-standalone-2.42.2.jar",
"log_path" : false,
"host" : "127.0.0.1",
"port" : 4444
},
"test_settings" : {
"default" : {
"launch_url" : "http://localhost",
"selenium_port"  : 4444,
"selenium_host"  : "localhost",
"silent": true,
"screenshots" : {
"enabled" : true,
"path" : "test/nightwatch/reports"
},
"desiredCapabilities": {
"browserName": "firefox",
"javascriptEnabled": true,
"acceptSslCerts": true
}
}
}
}

Definitely gives me the same output.

error: 'An unknown server-side error occurred while processing the command.'




Andrei Rusu

unread,
Jun 28, 2014, 4:25:12 PM6/28/14
to nightw...@googlegroups.com
and if you run it with --verbose?


Andrei Rusu

unread,
Jun 28, 2014, 4:33:17 PM6/28/14
to nightw...@googlegroups.com
Nevermind. It seems to be an error with the selenium server. Unfortunately the only info we get from it is "An unknown server-side error occurred while processing the command". I did a quick test with selenium server 2.40 and seems to work fine, so it must be something they changed recently. I'll look into it more to see if it's something I need to change in nightwatch. Sorry for the inconvenience.

David Linse

unread,
Jun 28, 2014, 4:38:10 PM6/28/14
to nightw...@googlegroups.com
works for me.. running on OSX with --verbose options and

$ node --version #=> 0.10.26 + selenium-server-standalone-2.42.jar

gives me..


INFO Response 200 POST /wd/hub/session{ status: 0,
  sessionId: '0f58008d-2897-4fb1-a6e3-26b23a154ea9',
  value: 
   { platform: 'MAC',
     acceptSslCerts: true,
     javascriptEnabled: true,
     browserName: 'firefox',
     rotatable: false,
     locationContextEnabled: true,
     'webdriver.remote.sessionid': '0f58008d-2897-4fb1-a6e3-26b23a154ea9',
     version: '30.0',
     cssSelectorsEnabled: true,
     databaseEnabled: true,
     handlesAlerts: true,
     browserConnectionEnabled: true,
     webStorageEnabled: true,
     nativeEvents: false,
     applicationCacheEnabled: true,
     takesScreenshot: true },
  state: null,
  class: 'org.openqa.selenium.remote.Response',
  hCode: 206365735 }
INFO Got sessionId from selenium 0f58008d-2897-4fb1-a6e3-26b23a154ea9
INFO Request: POST /wd/hub/session/0f58008d-2897-4fb1-a6e3-26b23a154ea9/url 
 - data:  {"url":"http://nightwatchjs.org/"} 
 - headers:  {"Content-Type":"application/json; charset=utf-8","Content-Length":34}
INFO Response 204 POST /wd/hub/session/0f58008d-2897-4fb1-a6e3-26b23a154ea9/url {}
LOG     → Completed command url (13480 ms)
INFO Request: POST /wd/hub/session/0f58008d-2897-4fb1-a6e3-26b23a154ea9/element 
 - data:  {"using":"css selector","value":"body"} 
 - headers:  {"Content-Type":"application/json; charset=utf-8","Content-Length":39}
INFO Response 200 POST /wd/hub/session/0f58008d-2897-4fb1-a6e3-26b23a154ea9/element{ status: 0,
  sessionId: '0f58008d-2897-4fb1-a6e3-26b23a154ea9',
  value: { ELEMENT: '0' },
  state: null,
  class: 'org.openqa.selenium.remote.Response',
  hCode: 591370671 }
INFO Request: GET /wd/hub/session/0f58008d-2897-4fb1-a6e3-26b23a154ea9/element/0/displayed 
 - data:   
 - headers:  {"Accept":"application/json"}
INFO Response 200 GET /wd/hub/session/0f58008d-2897-4fb1-a6e3-26b23a154ea9/element/0/displayed{ status: 0,
  sessionId: '0f58008d-2897-4fb1-a6e3-26b23a154ea9',
  value: true,
  state: null,
  class: 'org.openqa.selenium.remote.Response',
  hCode: 430594178 }
✔  Element <body> was visible after 229 milliseconds.
LOG     → Completed command waitForElementVisible (231 ms)
INFO Request: POST /wd/hub/session/0f58008d-2897-4fb1-a6e3-26b23a154ea9/element 
 - data:  {"using":"css selector","value":".sample-test"} 
 - headers:  {"Content-Type":"application/json; charset=utf-8","Content-Length":47}
INFO Response 200 POST /wd/hub/session/0f58008d-2897-4fb1-a6e3-26b23a154ea9/element{ status: 0,
  sessionId: '0f58008d-2897-4fb1-a6e3-26b23a154ea9',
  value: { ELEMENT: '1' },
  state: null,
  class: 'org.openqa.selenium.remote.Response',
  hCode: 1756723953 }
INFO Request: GET /wd/hub/session/0f58008d-2897-4fb1-a6e3-26b23a154ea9/element/1/value 
 - data:   
 - headers:  {"Accept":"application/json"}
INFO Response 200 GET /wd/hub/session/0f58008d-2897-4fb1-a6e3-26b23a154ea9/element/1/value{ status: 0,
  sessionId: '0f58008d-2897-4fb1-a6e3-26b23a154ea9',
  value: null,
  state: null,
  class: 'org.openqa.selenium.remote.Response',
  hCode: 755799207 }
>>>>>>>>> { status: 0,
  sessionId: '0f58008d-2897-4fb1-a6e3-26b23a154ea9',
  value: null,
  state: null,
  class: 'org.openqa.selenium.remote.Response',
  hCode: 755799207 }
LOG     → Completed command getValue (86 ms)
INFO Request: DELETE /wd/hub/session/0f58008d-2897-4fb1-a6e3-26b23a154ea9 
 - data:   
 - headers:  {"Content-Length":0}
INFO Response 204 DELETE /wd/hub/session/0f58008d-2897-4fb1-a6e3-26b23a154ea9 {}
LOG     → Completed command session (124 ms)
INFO FINISHED

OK. 1 total assertions passed. (16924 ms)




On Sat, Jun 28, 2014 at 10:15 PM, Zizeke <imre.f...@gmail.com> wrote:

David Linse

unread,
Jun 28, 2014, 4:40:34 PM6/28/14
to nightw...@googlegroups.com
sorry it's selenium-server-standalone-2.41.jar

Andrei Rusu

unread,
Jun 28, 2014, 4:56:51 PM6/28/14
to nightw...@googlegroups.com
It seems the getValue is gone from the 2.42 version. I suggest using the following work around until a proper fix will be released:

browser.getAttribute('<selector>', 'value', function(result) {
 
...
});
Message has been deleted

Zizeke

unread,
Jun 28, 2014, 6:05:10 PM6/28/14
to nightw...@googlegroups.com
Thanks, that works.

BTW, version 2.41 produced the same error, but 2.40 worked.

Mary Ann May-Pumphrey

unread,
Jun 30, 2014, 1:54:04 PM6/30/14
to nightw...@googlegroups.com

> I'm moving to nightwatchjs from webdriversio and having huge issues with it.

Hi Zizeke! Would you mind expanding a bit on why you decided to switch from webdriverio to nightwatch? These two were the "finalists" in my recent investigation of which WebDriver/JS binding we should we be using. My manager actually preferred webdriverio because it supported mocha, which is the testrunner we're already using for API tests. I talked him into letting me go with nightwatch but it would be nice to have additional "factoids" from real users for supporting evidence.

--Mary Ann

Hema

unread,
Jan 13, 2016, 10:42:52 AM1/13/16
to NightwatchJs

Hi all,
I would like to get the balance value using nightwatch js v0.8.15, Selenium sever standalone-2.48.2.jar based on below information,


<div class="libs-meter " id="meter-balance-container" style="display: block;"> 
<span class="title" style="font-size: 0.93em;">BALANCE</span> 
<span class="value" style="font-size: 1.01em;">£100,000,000.00</span>
</div>

My code look like,

client.getValue('#meter-balance-container.libs-meter',function(result){
console.log('Balance',result.value);
});

Output look like,

 Running: Demo test nightwatch
? Expected element to be present
Balance null

Balance value is retuning as null value. Can you please any one help on this.

Kind Regards,
Hema

Hema

unread,
Jan 13, 2016, 11:04:19 AM1/13/16
to NightwatchJs

Found the solution. Just changed getText instead of getValue.

client.getText('#meter-balance-container.libs-meter',function(result){
  console.log(result.value);
 });

Hema
Reply all
Reply to author
Forward
0 new messages