Note that there are some explanatory texts on larger screens.

plurals
  1. POCannot access static method when running thru main method from command line
    primarykey
    data
    text
    <p>I have a a method that is being called from Main but when the time comes to call the static method within it will not proceed and test stops. </p> <p>I have inserted log comments in order to tell where the problem is and no exceptions are caught so there is no compiling nor runtime errors so far.</p> <p>The static method that is not being called is <strong>GC2CommonMethods.loadApplication();</strong>. The weird thing is that <strong><em>when running Main from Eclipse IDE it runs perfectly but it does not when executing from jar file through the same Main method.</em></strong> </p> <p>See below both codes from the method that is being executed and the detail of the static method that is within a static class respectively. </p> <p>I would appreciate your help with this. Thanks.</p> <pre><code>//This method is intented to be called from Main method package com.mycompany.test.loginRoleEntitlements; public void verifyLoginPageElements() { logger.info("\t1.0/1.0.2 - Verif**strong text**ying Login page elements..."); try { logger.info("entering Try"); GC2CommonMethods.loadApplication(sl); //Static method from Static class. assertTrue("Region identifier is not present.", sl.isElementPresent(PageAttributes.LoginPage.DB_LABEL)); assertTrue("Forgot Password link is not present", sl.isElementPresent(PageAttributes.LoginPage.FORGOT_PASSWORD)); } catch (SeleniumException se) { logger.info("caught SeleniumException"); logger.error(se.getMessage()); throw se; } catch (AssertionFailedError ae) { logger.info("caught AssertionException"); logger.error(ae.getMessage()); throw ae; } catch (Exception e) { logger.info("caught Exception"); logger.info("Encountered exception"); e.printStackTrace(); } //This is the static method that is within GC2CommonMethods static class package com.mycompay.common; public static void loadApplication(SeleniumHandle sl) { sl.open(props.getProperty("APPLICATION_URL")); sl.waitForPageToLoad("30000"); assertEquals("The page is not the correct one. |Expected: "+PageAttributes.LoginPage.LOGINPAGE_TITLE + ". Found:"+sl.getTitle(),PageAttributes.LoginPage.LOGINPAGE_TITLE,sl.getTitle()); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload