Forum Discussion

m_atty's avatar
m_atty
Occasional Contributor
6 years ago

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

  • 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

  • richie's avatar
    richie
    Community Hero
    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
    • TanyaYatskovska's avatar
      TanyaYatskovska
      SmartBear Alumni (Retired)

      Thanks for sharing your suggestions, Richie, Rao!

      m_atty, did any of these replies help you?

  • m_atty's avatar
    m_atty
    Occasional Contributor

    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

    • richie's avatar
      richie
      Community Hero

      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

  • nmrao's avatar
    nmrao
    Champion Level 3
    Strange. What type of assertions do you have?