cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC Status assertion fails only when running at the test case/project level

SOLVED
Occasional Contributor

JDBC Status assertion fails only when running at the test case/project level

Hi all,

 

I've just created a new test case that creates a new Oracle user, gives it a specific role and then runs a set of SELECT queries to ensure if it has access to the views that it needs.

 

To do this, I've added a set of JDBC Request Test Steps. Each one just has a simple select statement (i.e. select * from *view name*). Each step also has a JDBC Status assertion which acts as my pass/fail (i.e. if the user doesn't have access to a particular view, that step will fail).

 

When I run each test step individually by clicking the play icon on the test step level, each step passes.

 

However, when I run the test case as a whole (by clicking the play icon on the test case or project level), a number of my test steps fail with the error: "table or view does not exist". However, when I then click on one of the failed test steps and re-run the test step at the step level it then passes.

 

Any idea why this could be happening and how I can resolve the issue?

 

Thanks in advance for your help,

Matt

1 ACCEPTED SOLUTION

Accepted Solutions
Occasional Contributor

Re: JDBC Status assertion fails only when running at the test case/project level

Thanks for the suggestions both.

 

I have split the test steps into individual test cases now, so rather than one test case having multiple JDBC test steps, each test case only has one JDBC connection.

 

This seems to have fixed the issue, although I still don't really understand the root cause.

 

Thanks again for the help.

 

Matt

5 REPLIES
Community Hero

Re: JDBC Status assertion fails only when running at the test case/project level

Strange. What type of assertions do you have?


Regards,
Rao.
Community Hero

Re: JDBC Status assertion fails only when running at the test case/project level

Performance.

Off the top of my head without looking at your logs it sounds like its related to a performance issue if your steps run individually but fail when running during execution.
Try and add a delay step after each jdbc test step....delay step uses millisecond unit of measurement so add something like 5 secs (5000) for each delay step before reducing the value.

Oh. 1 more thing. Are you saying that one of your steps is actually creating the oracle user/schema that holds the tables? Like the command 'create user username identified by passwordvalue default tablespace tablespacename temporary tablespace temp' or something similar? Reason i mention this is that creating a new oracle user/schema makes significant changes to the assigned tablespace (your tablespace is the file that holds your users/schemas) so it takes a sec or two to persist those changes in the tablespace.ora file


Cheers,

Richie
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the title of the post to something more descriptive? This will help people when searching for problems.
Community Manager

Re: JDBC Status assertion fails only when running at the test case/project level

Thanks for sharing your suggestions, Richie, Rao!

@m_atty, did any of these replies help you?

---------
Tanya Gorbunova
SmartBear Community Manager

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others.↓↓↓↓↓
Occasional Contributor

Re: JDBC Status assertion fails only when running at the test case/project level

Thanks for the suggestions both.

 

I have split the test steps into individual test cases now, so rather than one test case having multiple JDBC test steps, each test case only has one JDBC connection.

 

This seems to have fixed the issue, although I still don't really understand the root cause.

 

Thanks again for the help.

 

Matt

Community Hero

Re: JDBC Status assertion fails only when running at the test case/project level

as I said before - sounds like Performance and even more now that it works after splitting it out into individual test cases

 

anyway - you've got a work around (which is the main thing)

 

nice one

 

richie

if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the title of the post to something more descriptive? This will help people when searching for problems.
2018 NEWS
Top Kudoed Authors