-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Protractor oracledb connection failing with NoSuchSessionError #1002
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@bhoppeadoy Can you show us verify-design.e2e-spec? Also, is this needed/correct? let resultJSON = '';
(result.rows as any[]).forEach(row => {
if (resultJSON.length === 0) {
resultJSON = `[ ${row[0]}`;
} else {
resultJSON = resultJSON + `, ${row}`;
}
});
resultJSON = resultJSON + ']'; Maybe this is better? resultJSON = JSON.stringify(result.rows); |
@dmcghan Good point on the JSON.stringify(), not sure why the developer did it that way. I've updated the example to call ProductFolderSpec.OpenProductFolder(). Basically what I need the test to do is get a list of parts and their associated properties from an oracle database. Then for each part run the below spec. product-folder.e2e-spec.ts
|
Just checking: you're using node-oracledb in the mid-tier right, not in Angular? See #957 (comment) |
@bhoppeadoy Try commenting out this line in await Common.createScreenshot(); |
No, this is not in an Angular project. This is in a Protractor/Selenium End-to-End test. |
@dmcghan it never reaches that code. The exception is thrown in dbms.getConnection(). For simplification, you can remove product-folder.e2e-spec.ts from the call and just have this:
|
@bhoppeadoy How do you know where the exception is thrown. I don't see any line numbers in the error stack you showed. Maybe we're missing the output you're seeing? Earlier you said:
What makes you believe this is true? |
I'm not getting any type of error printed to the console when this is ran, so I'm not sure what exactly is failing. When I run in debug mode, I put a breakpoint in database.js at
and one at
After continuing from the first breakpoint I get the uncaught exception thrown. It never reaches the second breakpoint. The exception is thrown from webdriver.js |
@bhoppeadoy I still don't see how that the Oracle connection is failing without an error. As you say, the error is from webdriver.js, not node-oracledb. Could you please show us |
@dmcghan I even removed common.js to see if that was doing it but same issue. I agree that someting is being initialized as part of the test that is causing it. Probably something inherent with how Protractor/Selenium/Webdriver works that is causing it. I moved the call to getProductFolderParts() in the onPrepare() function of the protractor.conf.js file. This way the oracle connection is called before any other Protractor setup has happened. From there, it works and I get back the data that I'm wanting. This should solve my issue now. Thanks for working through this with me. |
@bhoppeadoy I'm glad you got it working! |
Node v8.9.4
node-oracledb v3.0.0
protractor v5.4.0
I'm trying to run a data-driven protractor test. First thing is run a query against oracle table to return a set of data. Then loop over that data calling other specs. The oracle connection is failing without an error. So I run in debug mode I get this uncaught exception:
Here's my test spec that protractor is running that's setting up the connection:
test.js
This is database.js
Is there another way that I'm supposed to set this up?
The text was updated successfully, but these errors were encountered: