I'm new to using withFrames in Geb, and I am trying to follow the examples in the Book of Geb.
I am trying to get my code to enter text and push a button within a frame.
The preferred way is to define the frame element inside your containing page, but for now I just want to see what I am doing wrong in my withFrame call.
def "Write and Post a Small Comment" () {
when:
MyBlogSpot bs = to MyBlogSpot
then:
bs.readMoreLink.click()
withFrame("comment-editor"){ // <---- this is the line 16 in the error statement
$('#commentBodyField') << "my text"
$("button", name:"postCommentSubmit").click()
}
}
The above is the spec.
The element I am trying to reach is:
<iframe allowtransparency="true" class="blogger- iframe-colorize blogger-comment-from-post" frameborder="0" height="194px" id="comment-editor" name="comment-editor" src="https://www.blogger.com/comment-iframe.g?blogID=3577645066754224503&postID=6815587395142211832&blogspotRpcToken=2994523#%7B%22color%22%3A%22rgb(34%2C%2034%2C%2034)%22%2C%22backgroundColor%22%3A%22rgb(255%2C%20255%2C%20255)%22%2C%22unvisitedLinkColor%22%3A%22rgb(204%2C%20102%2C%2017)%22%2C%22fontFamily%22%3A%22Arial%2C%20Tahoma%2C%20Helvetica%2C%20FreeSans%2C%20sans-serif%22%7D" width="100%" data-resized="true"></iframe>
No matter what arguments I use for withFrame - even if I use withFrame(2) after checking the browser debugger tool - the error I get when running the test is:
at CommentSpec.Write and Post a Small
Comment(CommentSpec.groovy:17)
Caused by:
org.openqa.selenium.WebDriverException: unknown error: call function result missing 'value'
(Session info: chrome=70.0.3538.77)
(Driver info: chromedriver=2.32.498550 (9dec58e66c31bcc53a9ce3c7226f0c1c5810906a),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T15:28:36.4Z'
System info: host: 'GUY-HP', ip: '192.168.1.2', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_161'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{mobileEmulationEnabled=false, hasTouchScreen=false, platform=XP, acceptSslCerts=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, platformName=XP, setWindowRect=true, unexpectedAlertBehaviour=, applicationCacheEnabled=false, rotatable=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.32.498550 (9dec58e66c31bcc53a9ce3c7226f0c1c5810906a), userDataDir=C:\Users\Guy\AppData\Local\Temp\scoped_dir12868_17851}, takesHeapSnapshot=true, pageLoadStrategy=normal, unhandledPromptBehavior=, databaseEnabled=false, handlesAlerts=true, version=70.0.3538.77, browserConnectionEnabled=false, nativeEvents=true, locationContextEnabled=true, cssSelectorsEnabled=true}]
Session ID: da4a617e55935af5a32b5c7c17213231
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)
at org.openqa.selenium.remote.http.JsonHttpResponseCodec.reconstructValue(JsonHttpResponseCodec.java:40)
at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:82)
at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:45)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:164)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:586)
at org.openqa.selenium.remote.RemoteWebDriver$RemoteTargetLocator.frame(RemoteWebDriver.java:912)
at geb.frame.DefaultFrameSupport.executeWithFrame(DefaultFrameSupport.groovy:57)
at geb.frame.DefaultFrameSupport.withFrame(DefaultFrameSupport.groovy:36)
at geb.Page.withFrame(Page.groovy:120)
at geb.Browser.methodMissing(Browser.groovy:217)
at geb.spock.GebSpec.methodMissing(GebSpec.groovy:60)
... 1 more
If there is any other code I need to paste in, please let me know. TIA!
This looks like a problem with version compatibility between the binaries.
The error shows your are using
chrome=70.0.3538.77
Driver info: chromedriver=2.32.498550
You want to download the latest chromedriver 2.43 which works with your version of Chrome. See here for compatible versions: Chrome Drivers
Related
In my project I use Karate 0.9.5, Oracle JDK8.
From time to time in our pipeline I see a problem. Karate fails to close earlier started Crome processes. Is there any solution to this problem?
I try to solved by explicitly call close() and quit() it didn't help. After running process was finished I found a couple of active chrome process on the server.
Here's a log:
12:51:45.227 preferred port 9222 not available, will use: 52436
12:51:47.524 request:
1 > GET http://localhost:52436/json
1 > Accept-Encoding: gzip,deflate
1 > Connection: Keep-Alive
1 > Host: localhost:52436
1 > User-Agent: Apache-HttpClient/4.5.11 (Java/1.8.0_181)
12:51:47.584 response time in milliseconds: 58,31
1 < 200
1 < Content-Length: 361
1 < Content-Type: application/json; charset=UTF-8
[ {
"description": "",
"devtoolsFrontendUrl": "/devtools/inspector.html?ws=localhost:52436/devtools/page/4BD6A5C19E01B01D88995CD69367F81F",
"id": "4BD6A5C19E01B01D88995CD69367F81F",
"title": "",
"type": "page",
"url": "about:blank",
"webSocketDebuggerUrl": "ws://localhost:52436/devtools/page/4BD6A5C19E01B01D88995CD69367F81F"
} ]
12:51:47.584 root frame id: 4BD6A5C19E01B01D88995CD69367F81F
12:51:47.632 >> {"method":"Target.activateTarget","params":{"targetId":"4BD6A5C19E01B01D88995CD69367F81F"},"id":1}
12:51:47.638 << {"id":1,"result":{}}
12:51:47.639 >> {"method":"Page.enable","id":2}
12:51:47.883 << {"id":2,"result":{}}
12:51:47.885 >> {"method":"Runtime.enable","id":3}
12:51:47.889 << {"method":"Runtime.executionContextCreated","params":{"context":{"id":1,"origin":"://","name":"","auxData":{"isDefault":true,"type":"default","frameId":"4BD6A5C19E01B01D88995CD69367F81F"}}}}
12:51:47.890 << {"id":3,"result":{}}
12:51:47.890 >> {"method":"Target.setAutoAttach","params":{"autoAttach":true,"waitForDebuggerOnStart":false,"flatten":true},"id":4}
12:51:47.892 << {"id":4,"result":{}}
12:52:02.894 << timed out after milliseconds: 15000 - [id: 4, method: Target.setAutoAttach, params: {autoAttach=true, waitForDebuggerOnStart=false, flatten=true}]
12:52:02.917 driver config / start failed: failed to get reply for: [id: 4, method: Target.setAutoAttach, params: {autoAttach=true, waitForDebuggerOnStart=false, flatten=true}], options: {type=chrome, showDriverLog=true, httpConfig={readTimeout=60000}, headless=true, target=null}
I think the easiest way to solve it is to extend root web driver interface com.intuit.karate.driver.Driver by adding additional method like getPID(). This method must return PID of launched process.
Can you log a bug and also provide some information as to what happened before this, are you using the Docker image etc. It looks like the previous Scenario did not shut down clearly.
But before that do you mind upgrading to 0.9.6.RC3 (just released) and trying that ? There have been a couple of tweaks to the life-cycle especially trying to close Chrome without waiting for a response. Also it may be worth adding a couple of changes a) Target.setAutoAttach without waiting and b) add configure option to not start Chrome if the port is in use
I am trying to use the new dcm4che release 5.22.0 and more specifically the dcmqrscp tool:
https://github.com/dcm4che/dcm4che/blob/master/dcm4che-tool/dcm4che-tool-dcmqrscp/README.md
I am starting an instance:
dcmqrscp -b DCMROUTER:435 --dicomdir /media/cdrom/DICOMDIR
But i am getting the following exception during the association request (no matter the study i am trying to send):
11:12:29,896 INFO - Accept connection Socket[addr=/127.0.0.1,port=52127,localport=4006]
11:12:29,917 DEBUG - /127.0.0.1:4006<-/127.0.0.1:52127(1): enter state: Sta2 - Transport connection open
11:12:29,937 INFO - DCMROUTER<-MAYAM(1) >> A-ASSOCIATE-RQ
11:12:29,942 DEBUG - A-ASSOCIATE-RQ[
calledAET: DCMROUTER
callingAET: MAYAM
applicationContext: 1.2.840.10008.3.1.1.1 - DICOM Application Context Name
implClassUID: 1.2.40.0.13.1.1
implVersionName: dcm4che-2.0
maxPDULength: 16384
maxOpsInvoked/maxOpsPerformed: 0/0
PresentationContext[id: 1
as: 1.2.840.10008.5.1.4.1.1.4 - MR Image Storage
ts: 1.2.840.10008.1.2 - Implicit VR Little Endian
]
PresentationContext[id: 3
as: 1.2.840.10008.5.1.4.1.1.4 - MR Image Storage
ts: 1.2.840.10008.1.2.1 - Explicit VR Little Endian
]
]
11:12:29,942 DEBUG - DCMROUTER<-MAYAM(1): enter state: Sta3 - Awaiting local A-ASSOCIATE response primitive
11:12:29,942 INFO - DCMROUTER<-MAYAM(1) << A-ASSOCIATE-AC
11:12:29,942 DEBUG - A-ASSOCIATE-AC[
calledAET: DCMROUTER
callingAET: MAYAM
applicationContext: 1.2.840.10008.3.1.1.1 - DICOM Application Context Name
implClassUID: 1.2.40.0.13.1.3
implVersionName: dcm4che-5.22.0
maxPDULength: 16378
maxOpsInvoked/maxOpsPerformed: 0/0
PresentationContext[id: 1
result: 0 - acceptance
ts: 1.2.840.10008.1.2 - Implicit VR Little Endian
]
PresentationContext[id: 3
result: 0 - acceptance
ts: 1.2.840.10008.1.2.1 - Explicit VR Little Endian
]
]
11:12:29,943 DEBUG - DCMROUTER<-MAYAM(1): enter state: Sta6 - Association established and ready for data transfer
11:12:29,947 INFO - DCMROUTER<-MAYAM(1) >> 1:C-STORE-RQ[pcid=3, prior=0
cuid=1.2.840.10008.5.1.4.1.1.4 - MR Image Storage
iuid=2.25.236888348187743071893701493905889154404.2 - ?
tsuid=1.2.840.10008.1.2.1 - Explicit VR Little Endian]
11:12:29,968 DEBUG - DCMROUTER<-MAYAM(1) >> 1:C-STORE-RQ Command:
(0000,0002) UI [1.2.840.10008.5.1.4.1.1.4] AffectedSOPClassUID
(0000,0100) US [1] CommandField
(0000,0110) US [1] MessageID
(0000,0700) US [0] Priority
(0000,0800) US [0] CommandDataSetType
(0000,1000) UI [2.25.236888348187743071893701493905889154404.2] AffectedSOPIns
11:12:29,969 DEBUG - DCMROUTER<-MAYAM(1) >> 1:C-STORE-RQ Dataset receiving...
11:12:29,969 INFO - DCMROUTER<-MAYAM(1): M-WRITE \media\cdrom\2.25.236888348187743071893701493905889154404.2
11:12:29,988 INFO - DCMROUTER<-MAYAM(1): M-RENAME \media\cdrom\2.25.236888348187743071893701493905889154404.2
11:12:30,072 INFO - M-UPDATE \media\cdrom\DICOMDIR: add STUDY Record
11:12:30,074 INFO - DCMROUTER<-MAYAM(1): M-DELETE \media\cdrom\DICOM\67EEF683\3AA0D620\7E6BFF30
11:12:30,075 INFO - DCMROUTER<-MAYAM(1): processing 1:C-STORE-RQ[pcid=3, prior=0
cuid=1.2.840.10008.5.1.4.1.1.4 - MR Image Storage
iuid=2.25.236888348187743071893701493905889154404.2 - ?
tsuid=1.2.840.10008.1.2.1 - Explicit VR Little Endian] failed. Caused by:
org.dcm4che3.net.service.DicomServiceException: org.dcm4che3.data.IncompatibleSpecificCharaterSetException: Specific Character Sets [] and [ISO_IR 100] not compatible
at org.dcm4che3.tool.dcmqrscp.DcmQRSCP$CStoreSCPImpl.store(DcmQRSCP.java:176)
at org.dcm4che3.net.service.BasicCStoreSCP.onDimseRQ(BasicCStoreSCP.java:72)
at org.dcm4che3.net.service.DicomServiceRegistry.onDimseRQ(DicomServiceRegistry.java:86)
at org.dcm4che3.net.ApplicationEntity.onDimseRQ(ApplicationEntity.java:474)
at org.dcm4che3.net.Association.onDimseRQ(Association.java:746)
at org.dcm4che3.net.PDUDecoder.decodeDIMSE(PDUDecoder.java:467)
at org.dcm4che3.net.Association.handlePDataTF(Association.java:729)
at org.dcm4che3.net.State$4.onPDataTF(State.java:103)
at org.dcm4che3.net.Association.onPDataTF(Association.java:725)
at org.dcm4che3.net.PDUDecoder.nextPDU(PDUDecoder.java:177)
at org.dcm4che3.net.Association$2.run(Association.java:562)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.dcm4che3.data.IncompatibleSpecificCharaterSetException: Specific Character Sets [] and [ISO_IR 100] not compatible
at org.dcm4che3.data.Attributes.add(Attributes.java:2103)
at org.dcm4che3.data.Attributes.addSelected(Attributes.java:2060)
at org.dcm4che3.media.RecordFactory.createRecord(RecordFactory.java:255)
at org.dcm4che3.tool.dcmqrscp.DcmQRSCP.addDicomDirRecords(DcmQRSCP.java:1087)
at org.dcm4che3.tool.dcmqrscp.DcmQRSCP$CStoreSCPImpl.store(DcmQRSCP.java:167)
... 13 more
11:12:30,083 INFO - DCMROUTER<-MAYAM(1) << 1:C-STORE-RSP[pcid=3, status=110H, errorComment=org.dcm4che3.data.IncompatibleSpecificCharaterSetException: Spec
tsuid=1.2.840.10008.1.2.1 - Explicit VR Little Endian]
11:12:30,083 DEBUG - DCMROUTER<-MAYAM(1) << 1:C-STORE-RSP Command:
(0000,0100) US [32769] CommandField
(0000,0120) US [1] MessageIDBeingRespondedTo
(0000,0800) US [257] CommandDataSetType
(0000,0900) US [272] Status
(0000,0902) LO [org.dcm4che3.data.IncompatibleSpecificCharaterSetException: Sp
11:12:30,088 INFO - DCMROUTER<-MAYAM(1) >> A-RELEASE-RQ
11:12:30,088 DEBUG - DCMROUTER<-MAYAM(1): enter state: Sta8 - Awaiting local A-RELEASE response primitive
11:12:30,088 INFO - DCMROUTER<-MAYAM(1) << A-RELEASE-RP
11:12:30,089 DEBUG - DCMROUTER<-MAYAM(1): enter state: Sta13 - Awaiting Transport Connection Close Indication
11:12:30,093 DEBUG - DCMROUTER<-MAYAM(1): closing Socket[addr=/127.0.0.1,port=52127,localport=4006] in 50 ms
11:12:30,142 INFO - DCMROUTER<-MAYAM(1): close Socket[addr=/127.0.0.1,port=52127,localport=4006]
11:12:30,142 DEBUG - DCMROUTER<-MAYAM(1): enter state: Sta1 - Idle
Any ideas what has changed in 5.22.0 and might cause this error?
As commented by #thanili:
It was a bug, fixed hopefully now. Please refer to github source code for more details.
Looking at source code on github, it seems the exception is recently added.
package org.dcm4che3.data;
/**
* #author Gunter Zeilinger (gunterze#protonmail.com)
* #since Mar 2020
*/
public class IncompatibleSpecificCharaterSetException extends IllegalArgumentException {
public IncompatibleSpecificCharaterSetException(String s) {
super(s);
}
}
Apparently, you need to set the supported Specific Character Sets yourself.
public void setSpecificCharacterSet(String... codes) {
ensureModifiable();
decodeStringValuesUsingSpecificCharacterSet();
setString(Tag.SpecificCharacterSet, VR.CS, codes);
}
Without it, it throws exception as here and here.
On command line as mentioned in readme:
--fs-desc-cs <code> Character Set used in File-set
Descriptor File ("ISO_IR 100" =
ISO Latin 1)
i'm running into an error in trying to start up the selenium firefox driver. it seems like others have hit snags at this step, and there is no readily available solution online, so hopefully this question will be broadly helpful. it seems like firefox is failing to establish an http server interface when initiated through selenium's driver. it appears that i can run firefox from the command line with no errors.
i should specify that i am doing this via ssh login to a linux container. i'm running python2.7 on Ubuntu 14.04 LTS (GNU/Linux 3.16.3-elastic x86_64). i have the latest version of selenium (2.44) installed, and i'm using firefox 34.0. i'm using xvfb to spoof a display.
below is my code, the error logs, and some related source code.
from selenium import webdriver
d = webdriver.Firefox()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/webdriver.py", line 59, in __init__
self.binary, timeout),
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/extension_connection.py", line 47, in __init__
self.binary.launch_browser(self.profile)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/firefox_binary.py", line 66, in launch_browser
self._wait_until_connectable()
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/firefox/firefox_binary.py", line 105, in _wait_until_connectable
raise WebDriverException("Can't load the profile. Profile "
selenium.common.exceptions.WebDriverException: Message: Can't load the profile. Profile Dir: %s If you specified a log_file in the FirefoxBinary constructor, check it for details.
that error is raised here, due to a timeout:
def _wait_until_connectable(self):
"""Blocks until the extension is connectable in the firefox."""
count = 0
while not utils.is_connectable(self.profile.port):
if self.process.poll() is not None:
# Browser has exited
raise WebDriverException("The browser appears to have exited "
"before we could connect. If you specified a log_file in "
"the FirefoxBinary constructor, check it for details.")
if count == 30:
self.kill()
raise WebDriverException("Can't load the profile. Profile "
"Dir: %s If you specified a log_file in the "
"FirefoxBinary constructor, check it for details.")
count += 1
time.sleep(1)
return True
in the log_file:
tail -f logs/firefox_binary.log
1418661895753 addons.xpi DEBUG checkForChanges
1418661895847 addons.xpi DEBUG No changes found
1418661895853 addons.manager DEBUG Registering shutdown blocker for XPIProvider
1418661895854 addons.manager DEBUG Registering shutdown blocker for LightweightThemeManager
1418661895857 addons.manager DEBUG Registering shutdown blocker for OpenH264Provider
1418661895858 addons.manager DEBUG Registering shutdown blocker for PluginProvider
System JS : ERROR (null):0 - uncaught exception: 2147746065
JavaScript error: file:///tmp/tmplkLsLs/extensions/fxdriver#googlecode.com/components/driver-component.js, line 11507: NS_ERROR_NOT_AVAILABLE: Component is not available'Component is not available' when calling method: [nsIHttpServer::start]
*** Blocklist::_preloadBlocklistFile: blocklist is disabled
1418661908552 addons.manager DEBUG Registering shutdown blocker for <unnamed-provider>
one more point of information. early on, in the firefox driver initalization, socket.bind(('127.0.0.1',0)) was failing with a "can't assign requested address" error. i changed the location to (0.0.0.0,0) and edited the localhost entry in my /etc/hosts, and was able to bind that way. not sure if that could be causing the current failure though.
VV edits per louis's request VV . i specify the two lines where i change the localhost address.
def free_port():
"""
Determines a free port using sockets.
"""
free_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
free_socket.bind(('0.0.0.0', 0)) # changed from 127.0.0.1
free_socket.listen(5)
port = free_socket.getsockname()[1]
free_socket.close()
return port
def is_connectable(port):
"""
Tries to connect to the server at port to see if it is running.
:Args:
- port: The port to connect.
"""
try:
socket_ = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
socket_.settimeout(1)
socket_.connect(("0.0.0.0", port)) # changed again
socket_.close()
return True
except socket.error:
return False
here's the constructor from webdriver:
def __init__(self, firefox_profile=None, firefox_binary=None, timeout=30,
capabilities=None, proxy=None):
self.binary = firefox_binary
self.profile = firefox_profile
if self.profile is None:
self.profile = FirefoxProfile()
self.profile.native_events_enabled = (
self.NATIVE_EVENTS_ALLOWED and self.profile.native_events_enabled)
if self.binary is None:
self.binary = FirefoxBinary()
if capabilities is None:
capabilities = DesiredCapabilities.FIREFOX
if proxy is not None:
proxy.add_to_capabilities(capabilities)
RemoteWebDriver.__init__(self,
command_executor=ExtensionConnection("127.0.0.1", self.profile,
self.binary, timeout),
desired_capabilities=capabilities,
keep_alive=True)
self._is_remote = False
here's the constructor from extension_connector:
def __init__(self, host, firefox_profile, firefox_binary=None, timeout=30):
self.profile = firefox_profile
self.binary = firefox_binary
HOST = host
if self.binary is None:
self.binary = FirefoxBinary()
if HOST is None:
HOST = "127.0.0.1"
PORT = utils.free_port()
self.profile.port = PORT
self.profile.update_preferences()
self.profile.add_extension()
self.binary.launch_browser(self.profile)
_URL = "http://%s:%d/hub" % (HOST, PORT)
RemoteConnection.__init__(
self, _URL, keep_alive=True)
in posting my edits to louis's comment, i saw that my localhost issue turned up in other locations, as the host is hardcoded in twice more. i had my server master address the issue, changed everything in the source back to 127, and the problem was solved. thanks for prompting me, #louis, and i'm sorry my question wasn't more interesting. will accept my own answer after 2 days when SO allows me.
I had followed the instructions in https://developers.google.com/native-client/devguide/tutorial#verify
However, it seems all the examples are not running well. Had tried set NACL_SDK_ROOT to /nacl_sdk/ and /nacl_sdk/pepper_23/ but still no working
e.g., in "Interactive Hello World in C++", when trying to click the button of "Call reverseText()", nothing is seen.
With development tools I see the console output is:
Uncaught TypeError: Cannot call method 'postMessage' of null example.js:25
Here is part of the example.js:
22: function reverseText() {
23: // Grab the text from the text box, pass it into reverseText()
24: var inputBox = document.getElementById('inputBox');
25: common.naclModule.postMessage('reverseText:' + inputBox.value);
26: }
Looks like the reason is "common.naclMode is null". How to fix this error?
--EDIT--
When I was trying another example of "hello world", the output of http server is:
localhost - - [07/Jan/2013 15:52:42] "GET / HTTP/1.1" 200 -
localhost - - [07/Jan/2013 15:52:45] "GET /hello_world/index.html HTTP/1.1" 200 -
localhost - - [07/Jan/2013 15:52:45] "GET /hello_world/index_newlib_Debug.html HTTP/1.1" 200 -
localhost - - [07/Jan/2013 15:52:45] "GET /hello_world/common.js HTTP/1.1" 200 -
localhost - - [07/Jan/2013 15:52:45] "GET /hello_world/newlib/Debug/hello_world.nmf HTTP/1.1" 200 -
localhost - - [07/Jan/2013 15:52:45] "GET /hello_world/newlib/Debug/hello_world_x86_64.nexe HTTP/1.1" 200 -
I see following on the page:
Hello World.
Status: Creating embed: newlib
And the console outputs:
NativeClient: NaCl module load failed: Nexe crashed during startup
Here is ouput of objdump:
nacl_sdk/pepper_23/examples/hello_world$ ../.././toolchain/linux_x86_newlib/bin/x86_64-nacl-objdump -p newlib/Debug/hello_world_x86_64.nexe
newlib/Debug/hello_world_x86_64.nexe: file format elf64-nacl
Program Header:
PHDR off 0x0000000000000000 vaddr 0x0000000000000000 paddr 0x0000000000000000 align 2**3
filesz 0x0000000000000120 memsz 0x0000000000000120 flags r--
LOAD off 0x0000000000010000 vaddr 0x0000000000020000 paddr 0x0000000000020000 align 2**16
filesz 0x0000000000021ac0 memsz 0x0000000000021ac0 flags r-x
LOAD off 0x0000000000040000 vaddr 0x0000000010020000 paddr 0x0000000010020000 align 2**16
filesz 0x0000000000010474 memsz 0x0000000000010474 flags r--
LOAD off 0x0000000000060000 vaddr 0x0000000010040000 paddr 0x0000000010040000 align 2**16
filesz 0x00000000000006e8 memsz 0x0000000000001da8 flags rw-
Output of chrome with VERBOSITY=5:
[deqing#hdell]~/works/nacl_sdk/pepper_23$ export NACLVERBOSITY=5
[deqing#hdell]~/works/nacl_sdk/pepper_23$ google-chrome http://localhost:5103
[7,3729430976:11:56:19.763373] NaClRefCountCtor(0x7fb3e5184ac0).
[7,3729430976:11:56:19.763465] NexeFileDidOpen: invoking LoadNaClModule
...
[12,1392863616:03:56:19.825517] nacl_debug(136) : Debugging started.
[12,1392863616:03:56:19.825545] setting stack to : 00007fcefffeffa0
[12,1392863616:03:56:19.825557] copying arg 0 0x7fd95a7b1a40 -> 0x7fcefffeffd0
[12,1392863616:03:56:19.825568] copying env 0 0x7ffff4941bd6 -> 0x7fcefffeffd9
[12,1392863616:03:56:19.825575] copying env 1 0x7ffff4941c95 -> 0x7fcefffeffea
[12,1392863616:03:56:19.825583] system stack ptr : 00007fcefffeff98
[12,1392863616:03:56:19.825589] user stack ptr : 00007fcefffeff98
[12,1392863616:03:56:19.825595] natp = 0x000000000181fa80
[12,1392863616:03:56:19.825603] nap = 0x00007ffff493b9a0
[12,1392863616:03:56:19.825609] usr_stack_ptr = 0x00007fcefffeff98
[12,1392863616:03:56:19.825639] NaClWaitForMainThreadToExit: taking NaClApp lock
[12,1392863616:03:56:19.825648] waiting for exit status
[12,1376372480:03:56:19.825665] NaClThreadLauncher: entered
[12,1376372480:03:56:19.825684] natp = 0x000000000181fa80
[12,1376372480:03:56:19.825691] prog_ctr = 0x00007fce0fc00200
[12,1376372480:03:56:19.825698] stack_ptr = 0x00007fcefffeff98
[12,1376372480:03:56:19.825708] ix 0: 0x00000000
[12,1376372480:03:56:19.825716] found first not-all-ones ix 0
[12,1376372480:03:56:19.825723] Set(0,0x181fa80) #ix 0: 0x00000000
[12,1376372480:03:56:19.825729] After #ix 0: 0x00000001, avail_ix 0
Why the nexe crashed? Can anyone shed some light? Thanks.
the log message
nacl_debug(136) : Debugging started.
indicates you have "Native Client GDB-based debugging" turned on in about:flags. when this happens, gdb is expected to connect to port 4014. are connecting gdb to the debug stub? could you check your about:flags and turn off gdb-based debugging if you didn't really want it?
I need to click on a link pointed by following xPath : html/body/div[2]/ul/li[9]/a (generated using firepath) The corresponding Html snippes is as following :
< a href="/abb/logout">Logoff
My code is like this :
HtmlUnitDriver driver= new HtmlUnitDriver(BrowserVersion.FIREFOX_3_6);
WebElement logoffElement = (new WebDriverWait(driver, 10))
.until(new ExpectedCondition<WebElement>(){
#Override
public WebElement apply(WebDriver d) {
return d.findElement(By.xpath("html/body/div[2]/ul/li[9]/a"));
}});
logoffElement.click();
The above code is working for Firefoxdriver but not in HtmlUnitdriver. HtmlUnitdriver gives following error :
Caused by: org.openqa.selenium.NoSuchElementException: Unable to locate a node using html/body/div[2]/ul/li[9]/a
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '2.21.0', revision: '16552', time: '2012-04-11 19:08:38'
System info: os.name: 'Windows XP', os.arch: 'x86', os.version: '5.1', java.version: '1.6.0_23'
Driver info: driver.version: HtmlUnitDriver
at org.openqa.selenium.htmlunit.HtmlUnitDriver.findElementByXPath(HtmlUnitDriver.java:802)
at org.openqa.selenium.By$ByXPath.findElement(By.java:344)
at org.openqa.selenium.htmlunit.HtmlUnitDriver$5.call(HtmlUnitDriver.java:1244)
at org.openqa.selenium.htmlunit.HtmlUnitDriver$5.call(HtmlUnitDriver.java:1)
at org.openqa.selenium.htmlunit.HtmlUnitDriver.implicitlyWaitFor(HtmlUnitDriver.java:984)
at org.openqa.selenium.htmlunit.HtmlUnitDriver.findElement(HtmlUnitDriver.java:1241)
at org.openqa.selenium.htmlunit.HtmlUnitDriver.findElement(HtmlUnitDriver.java:396)
at com.nike.automation.Task$1.apply(Task.java:70)
at com.nike.automation.Task$1.apply(Task.java:1)
at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:201)
HtmlUnitDriver is a fake browser, which can't handle javascript and lacks of features which normal browsers have. FirefoxDriver or ChromeDriver use real browsers.
//html/body/div[2]/ul/li[9]/a -- Absolute XPath.
It is not advisable to use Absolute XPath. Use Relative XPath so that it will be working in all browsers.
Thanks!