About Me

My photo
I work for Myriad IT Services . Connect with me on linked in here . I'm always looking for the next strategic engagement.

Tuesday, 22 November 2016

openscript and spaces in databank alias’

Don’t put spaces in you databank alias in openscript – period.

Background

You might spend a couple of nights that you’ll never get back (like me) working out why your permutations and combinations of openscript command line options are not working.

OTM uses a commandline interface to openscript.

Things that work in openscript do not always work when calling from OTM.

To see commandline options,  http://docs.oracle.com/cd/E59557_01/OPSUG/opscrpt_cli_tools.htm#BEIFCJFF

One issue in particular is that spaces in the databank filename will fail in OTM.

The basis of this post is that a databank alias with spaces does not work when it goes to OTM.  You can quickly see this when you run the script.  You get 0 errors in the execution and there is also nothing written to your log file in c:\OracleATS\logs

Does not work:

-dbopts alias=0502 Setting Up Service Types:startIndex=11,alias=LoginCredentials:startIndex=1 -DelayPercentage -1 -delayMinSeconds 5 –delayMaxSeconds

-dbopts alias=”0502 Setting Up Service Types”:startIndex=11,alias=LoginCredentials:startIndex=1 -DelayPercentage -1 -delayMinSeconds 5 –delayMaxSeconds

c:\oracleATS\logs\process_console_2016-11-22T15-52-04.972adc5179a-66e5-46e6-8e63-503faa65a3e3_.log

Running "0502 Setting Up Service Types" ...
10:41:12,325 INFO  [DeploymentLogger] creating data source for databank "LoginCredentials". Databank usage: Advance record: by script request, Select record: sequentially, Out of records: loop continuously, Start record: 1, Seed value=0
10:41:12,361 INFO  [DeploymentLogger] creating data source for databank "0502 Setting Up Service Types". Databank usage: Advance record: by script request, Select record: sequentially, Out of records: loop continuously, Start record: 1, Seed value=0

Does work:

image

Ensure that the alias in the databank definition in your script does not have spaces – see above.  Get to this from

image

-dbopts alias=0502SettingUpServiceTypes:startIndex=11,alias=LoginCredentials:startIndex=1 -DelayPercentage -1 -delayMinSeconds 5 –delayMaxSeconds

image

I passed in a startIndex of 4 above, and I can see that the correct substitution is being used.

So, it just does the default databank operation – not using your command line override.

When you remove the spaces from your databank, it iterates as designed:

image

More on databanks and script design

The way OTM works is that you need to configure a pile of command line options if you are doing fancy things with databanks.  This is a little frustrating, as you need to understand the complete lifecycle of your test cases to ensure that the setup of an individual script is going to be correct.

For example, rule 1 – don’t think that you can scroll through a databank on different days and remember were you are up to, you cannot.  You also cannot pass in a pointer at the command line to do this for you.  You would need to maintain the pointer (or current databank record) in a text file (or database file) and update this at the end of every script and also use this on your call to “get next record”.

-dbopts alias=0502SettingUpServiceTypes:startIndex=11,alias=LoginCredentials:startIndex=1 -DelayPercentage -1 -delayMinSeconds 5 –delayMaxSeconds

The startIndex setting cannot be fed into this test set – I need to change this every time.

So, I need to do this in the script:

int scriptIterationCounter;

getDatabank("0506VCAMEnteringMeterReadings").getNextDatabankRecord(scriptInterationCounter);

Wednesday, 16 November 2016

configure SMTP server for OATS–oracle application testing suite

Goto the management app

http://localhost:8088/admin/Login.do – use localhost if you are on the server.

image

Login with Administrator

image

Make sure that you pull down the database tab and select OATS_otm_DS

image

Then goto tools and setup SMTP

image

enter your details and then test.

image

And you get your email – ace!

Note that you need to setup the email address of the user too, this is done also from the main screen:

image

This is also from the admin application.

openscript and OTM–automated regression testing of JD Edwards using openscript and OTM

Wow, this has been a real struggle.  I have a team writing awesome test scripts with openscript.  They work every time…  Awesome!

My job is to whack these into OTM, but gosh (best swear word I have at this stage), this is difficult.

The scripts are bombing all over the place, they are bombing on fast path, they are bombing on finding controls – FAR OUT!

So, my scripts work every time in openscript (once repositories are created [they are a terrible concept too btw])

Fail everytime in OTM.

image

image

See above for details.

I’ve done lots of things to try and fix this, which includes writing java code and also reverse engineering the EOneUtility files (which are AWESOME!).

Nothing has worked, then I stumble on:

https://support.oracle.com/epmos/faces/DocContentDisplay?_afrLoop=326776020417876&id=984133.1&_afrWindowMode=0&_adf.ctrl-state=165att5g2v_233

This is pretty good – not relevant to JDE – but I can draw analogies with the content.

Also the instruction does not work, but I have one that does.

So, what you need to do is stop the service

image

And now start is as the user that you want, I’ve done this from a command window that is run as admin

image

c:\OracleATS\agentmanager\bin>agentmanager.cmd

Now, run a test through OTM – and POW – it actually starts windows and works.

This is quite a relief, as I thought I was going to need jenkins to start running all of the openscript tasks (note that this is totally possible), as per https://docs.oracle.com/cd/E25294_01/doc.920/e15488/opscrpt_cmd_line.htm

Tuesday, 8 November 2016

running on AWS and need to increase your limits?

This can generally be done within an hour.  Just go to this page and choose the limit that you want to increase.  This will raise a support call that get’s actioned very quickly

https://ap-southeast-2.console.aws.amazon.com/ec2/v2/home?region=ap-southeast-2#Limits:

image

Just click the link to get it increased – that was easy!

Wednesday, 2 November 2016

automated JDE regression testing with OATS

I’ve been doing a lot of work with OTM and OATS for JD Edwards.  This is interesting for the main part, but there have been a couple of challenges along the way.  One of significance was that all of my scripts were working perfectly with openscript, but all failing with “Cannot get a connection from helper after 120 seconds.”

You get to see a much better summary of all your tests on the OATS server in a dir like:

C:\OracleATS\otm\Temp\1478063527633

This will allow you to search and find errors easier.  You can also open the following window in it’s own browser location:

image

image

That is a good find!

But, back to the error :  Cannot get a connection from helper after 120 seconds.

Note that this manifested itself with the following text in c”\oracleATS\logs\process_console_2016-10-31T11-17-31.647a21dbaab-a2f5-400d-b746-8b0be57ac651_

11:19:35,452 ERROR [PlayBackHandler] oracle.oats.scripting.modules.webdom.common.api.exception.BrowserHelperException: Cannot get a connection from helper after 120 seconds.
11:19:37,656 ERROR [1] Error in section Initialize at line (script.java:22). Cannot get a connection from helper after 120 seconds.
oracle.oats.scripting.modules.browser.api.utilities.exceptions.BrowserException: Cannot get a connection from helper after 120 seconds.
    at oracle.oats.scripting.modules.browser.api.utilities.exceptions.BrowserException.createBrowserException(BrowserException.java:27)
    at oracle.oats.scripting.modules.webdom.api.internal.InternalWebDOMService.onAfterLaunch(InternalWebDOMService.java:1434)
    at oracle.oats.scripting.modules.browser.api.BrowserService.onAfterLaunch(BrowserService.java:567)
    at oracle.oats.scripting.modules.browser.api.BrowserService.launch(BrowserService.java:319)
    at script.initialize(script.java:22)
    at oracle.oats.scripting.modules.basic.api.IteratingVUser.initialize(IteratingVUser.java:428)
    at oracle.oats.scripting.modules.basic.api.internal.IteratingAgent.run(IteratingAgent.java:720)
    at java.lang.Thread.run(Thread.java:745)
Caused by: oracle.oats.scripting.modules.webdom.common.api.exception.BrowserHelperException: Cannot get a connection from helper after 120 seconds.
    at oracle.oats.scripting.modules.webdom.api.internal.PlayBackHandler.start(PlayBackHandler.java:155)

This was finally sorted by running the 3 oracle ATS services as a domain account:

image

Once this was done, I started to get other different failures!!  fun fun.

Now I’m dealing with:

21:47:36,827 INFO  [1] End Step: [1] JD Edwards (/E1Menu.maf). Step execution time: 1.653 seconds
21:47:36,868 INFO  [1] Step: [2] JD Edwards EnterpriseOne (/E1Menu.maf)
21:49:40,280 ERROR [1] Error in section Run at line (script.java:99). Find Object timeout. Detail information:/web:window[@index='0' or @title='JD Edwards']/web:document[@index='0']/web:span[@text='Asset Management'].
oracle.oats.scripting.modules.webdom.common.api.exception.ObjectNotFoundException: Find Object timeout. Detail information:/web:window[@index='0' or @title='JD Edwards']/web:document[@index='0']/web:span[@text='Asset Management'].
    at oracle.oats.scripting.modules.webdom.api.elements.DOMTestObject.checkTestObject(DOMTestObject.java:237)
    at oracle.oats.scripting.modules.webdom.api.elements.DOMTestObject.checkTestObject(DOMTestObject.java:261)
    at oracle.oats.scripting.modules.webdom.api.elements.DOMTestObject.checkTestObject(DOMTestObject.java:269)
    at oracle.oats.scripting.modules.webdom.api.elements.DOMElement.checkTestObject(DOMElement.java:2107)
    at oracle.oats.scripting.modules.webdom.api.elements.DOMElement.checkElement(DOMElement.java:769)
    at oracle.oats.scripting.modules.webdom.api.elements.DOMElement.click(DOMElement.java:244)
    at script.run(script.java:99)
    at oracle.oats.scripting.modules.basic.api.IteratingVUser.run(IteratingVUser.java:353)
    at oracle.oats.scripting.modules.basic.api.internal.IteratingAgent.run(IteratingAgent.java:801)
    at java.lang.Thread.run(Thread.java:745)
21:49:40,285 ERROR [1] Iteration 1 failed at line (script.java:99). Find Object timeout. Detail information:/web:window[@index='0' or @title='JD Edwards']/web:document[@index='0']/web:span[@text='Asset Management'].
oracle.oats.scripting.modules.webdom.common.api.exception.ObjectNotFoundException: Find Object timeout. Detail information:/web:window[@index='0' or @title='JD Edwards']/web:document[@index='0']/web:span[@text='Asset Management'].
    at oracle.oats.scripting.modules.webdom.api.elements.DOMTestObject.checkTestObject(DOMTestObject.java:237)

Ahh terrific.  This will be a post for another night!

Monday, 24 October 2016

Trying to log into OATS–404 once again

OATS is often on struggle street,  open up the interface from your favourites and  http://localhost:8088/otm/ – you get a wonderful 404!

Error 404--Not Found

From RFC 2068 Hypertext Transfer Protocol -- HTTP/1.1:
10.4.5 404 Not Found

The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent.

If the server does not wish to make this information available to the client, the status code 403 (Forbidden) can be used instead. The 410 (Gone) status code SHOULD be used if the server knows, through some internally configurable mechanism, that an old resource is permanently unavailable and has no forwarding address.

Great, we know that OATs runs on weblogic and is tightly integrated with the database.  We also know that you can use openScript completely independently of the local database.  You can record any number of scripts locally on a machine, as long as the TestManager or LoadTesting software can see where you have recorded all of your scripts – they can do the coordination.

Anyway, back to the problem.

search for *.log in your OATS install directory and you’ll get a bunch of red herrings:

image

Standard messages about not being able to connect to the database, arrgghhh.

####<18/10/2016 3:26:24 PM EST> <Info> <EJB> <devsoe-PC> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <oats> <BEA1-00002F17E612A743959C> <> <1476764784913> <WL-010227> <EJB Exception occurred during invocation from home or business: weblogic.ejb.container.internal.StatelessEJBHomeImpl@152942e threw exception: javax.persistence.PersistenceException: Exception [EclipseLink-7060] (Eclipse Persistence Services - 2.3.1.v20111018-r10243): org.eclipse.persistence.exceptions.ValidationException
Exception Description: Cannot acquire data source [OATS_common_DS].
Internal Exception: javax.naming.NameNotFoundException: Unable to resolve 'OATS_common_DS'. Resolved ''; remaining name 'OATS_common_DS'>
####<18/10/2016 3:26:24 PM EST> <Error> <HTTP> <devsoe-PC> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1476764784932> <WL-101216> <Servlet: "struts-action" failed to preload on startup in Web application: "olt".
javax.ejb.EJBException: EJB Exception: ; nested exception is:
    javax.persistence.PersistenceException: Exception [EclipseLink-7060] (Eclipse Persistence Services - 2.3.1.v20111018-r10243): org.eclipse.persistence.exceptions.ValidationException
Exception Description: Cannot acquire data source [OATS_common_DS].

Load up the Database config utility from the start menu, or run C:\OracleATS\bin\DbConfig.bat

image

you’ll eventually get a java screen with the local database connection information (sorry, might not be local)

image

Choose save and it’ll try the connection and give you a MASSIVE hint as to the problem, password expiry!  Wow, that is a painful policy / feature.

image

http://shannonscncjdeblog.blogspot.com.au/2014/10/oracle-accounts-expired-dont-let-it.html

Above link will show you what to do, I’ll do the heavy lifting though, save you some work.

sqlplus / as sysdba

select username, account_status, expiry_date, profile from dba_users;

image

You’ll get a pile of locked accounts as above

select resource_name,limit from dba_profiles;

image

alter the profile limit and see the results:

alter profile default limit password_life_time unlimited ;

image

okay, the limit is changed, but we need to unlock the accounts, as they still fail to log in:

image

Even though I execute an “alter user account unlock”, The password is still expired.

ALTER USER otm identified by XXXX;

ALTER USER oats identified by XXXX;

ALTER USER olt identified by XXXX;

ALTER USER OTM account unlock;

ALTER user OATS account unlock;

ALTER user OLT account unlock;

So, now you need to remember the password you assigned to administrator when you installed oats (well I did), and then “alter user otm identified by XXXXX”;

This triggered the correct change to the profile to get everything working

 

You should then restart your OATs machine (or just the services) and everything should come up working!

image

Yay!

Tuesday, 18 October 2016

Tools 9.2.0.5 and list view

This is a nice enhancement, seen it?

Get a demo account for http://e92demo.myriad-it.com/jde/E1Menu.maf and take a gander.

Have you ever seen the address book look like this:

image

This is easy to do now with list view.

image

This is a new type of user override which gives you the ability to look at things a little differently.

You can also search any of the data on the page easily.

image

Hitting the grid format button above, you’ll see

image

Add the fields that you want, choosing additional lines

image

See that 1 will just give you the data and 2 will give you the field title and the data.

You can also choose your sequencing

image

This is a paste from chrome:

image

You can use control and select specific rows and act upon just them!

Cut and paste does NOT work from the list view

Address Number    Sch Typ    Tax ID    Alpha Name
4    O         Alternate US Parent
43    V         Asia Supplies
280    O         Argentian Company
301    O         Argentina Company
306    O         Australian Company
610    O         Australian Operations
1002    C         ADDA Laurent
1007    C         Andrew Blabla
1030    E    833776655    Allen, Wayne
1616    E         ABC