Tuesday, 25 July 2017

Oracle APEX 5.1, ATAF and automated testing

Oracle APEX 5.1, ATAF and automated testing


ATAF - Why not giving it a chance?


Step 1. Configuration and installation – hands on experience


Back to everyday work with some spare time to try out what I picked up from this year’s KScope17. 

Among many great sessions I taken with me, one that I decided to try out now is ATAF – APEX test automation framework.



Writing and maintenance of testing scripts is something none of us like doing but it is something that can safe heaps of time later in the project. I am hoping that we do not have to go into why you want to automate your testing and all the benefits it brings.

From my developers perspective, having to deal with maintenance of scripts that I created in Selenium wasn’t most exciting thing but over time it has proven to be a challenge and was taking way too much of my project time. This is why I got excited about Simon’s project and ATAF. If it could reduce the time needed just from maintenance perspective I think we have something good in our hands.

After spending roughly a week with ATAF I decided to write down initial thoughts and how it all went.

Please note this is my personal view about ATAF and your experience might be slightly different. Any ‘negative’ comment (if any :) ) is only meant to be a constructive criticism to help make this a better tool for all of us.

Download and documentation
Good thing is that Simon and the team made an effort to make it publicly available on Github https://github.com/schunt1/ATAF

After you get the source there is a Documentation folder giving you all necessary information about how it works and how to install ATAF.

Installation
As per documentation there is an option for you to install ATAF in your existing scheme or installing it on its own.

I decided to install it in its separate schema as I have too many workspaces I need this for so wanted to reduce multiple installations.

Basically it consisted of creating a new DB schema with create view grant, new workspace and running install.sql script. Installation was pretty easy and it did require a recompilation of all objects as per documentation. Installation script did need a "/" at the end otherwise it just hang in my SQL session.

Configuration
Again following the documentation there was not much to do here. There were some additional view changes to support running from separate schema.
Only addition was that ATAF schema required grant execute on DBMS_LOCK package.

First run
After ATAF application was imported into my workspace, this is where things started to go slightly off the rails. Do not get me wrong, nothing that you will not able to fix but it did need some additional interventions.   
Basically things were hooked up to hardcoded theme number 42 which is a default value for all default testing data. In my case I was using custom build theme with ID 40000 so had to make some changes to original scripts. I am expecting that most people with Universal theme (42) would not have to do the same.

Changes and comments
Application pages I had to change:
Page 1 – fetch returns multiple rows error
Page 2 – Select LOV invalid
Page 3 – Actions did not see my Interactive Grid JS buttons
Page 18 – LOV needed a change
Files updated to fix above issues:
ataf_apex_applications_v
ataf_apex_page_items
ataf_apex_page_items_v
ataf_apex_pages_v
ataf_apex_shortcuts_v
ataf_apex_themes_v
ataf_test_condition_full_v
ataf_test_condition_v
ATAF_PKB
ataf_selenium_for_custom_theme
To align with my domain needed to do this update
update ataf_selenium
set target = replace(target, 'ords', 'apex/lbs')
where theme_number = '40000'
and target like '%/apex/%';

As you can see it wasn’t all smooth sailing but now that I am actually able to run ATAF I am pleasantly surprised. 
I was able to create my dummy testing scripts which ran perfectly fine in Selenium after just 2 days of work which is pretty good in my eyes without having to know a single line of ‘Selenium scripting’.
Challenges and still to come
Since I am still in early days learning ATAF and all of its features it did take me a while to get running. I also think that initially there will be a learning curve for all to grasp how it all works. 

After a day or so of using ATAF I was able to add test data and framework made it easy to loop through my test-cases which nice to see. 

Selecting menus, buttons and entering page items was not a problem.

If I can point anything as challenging, I am still learning how is it best to create new actions that will do custom validations in my 5.1 apps. 

Also it will be interesting to see how I will survive with my xpath selector knowledge as I am more used to class selectors. 

But hey feeling about ATAF is positive and I think this is all that matters. 

To summarize, hope more of us will give ATAF a go and would love to see what others make of it. 

In next couple of days I will try my best to dedicate more time figuring out some new things in ATAF and putting it all together for Part 2 of this post.

Happy Apexing,
SLino 

Thursday, 13 July 2017

Oracle APEX at KSCOPE17

APEX at KSCOPE17

Why is it so damn good! :)

Summary of thoughts  

Yet another great conference by APEX community - what else can you say when you have such a busy program and abundance of awesome speakers presenting.
 
 
I loved it yet again. Great people above all, location and content.

This was my third time and again I came back with loads of notes and things to try out when I get back. Not more can you wish for.

There were talks if this year was as good as previous one, but overall I think people from ODTUG hit the mark again (at least for me).

Overview and my takeaway
Lots of great ideas/features from the team for APEX 5.2 release.

Universal theme - Shakeeb

-       Inline help text for form customizations
-       Ability to adjust region dialog size
-       Declarative touch events like swap
-       Improve responsive styles
-       Improve loading performance
-       HD version of icons – Font APEX HD
-       Floating labels modernizing UI
-       New Card templates like header and media
-       Improvements on theme rolling with additional styles and options
-       APEX Spotlight
-       Effortless navigation


JET charts – Marc S.

-       Improvements in customization over 5.1.2 version
-       Ability to use select * from table as source of your queries
-       Zoom in zoom out functionality
-       Adjusting series colours either as query column or using advance JS configuration similar how IG is done now
-       Ability to change orientation using DA
-       New chart types like Gant charts, pyramid or box plot

Interactive Grid – John S.

-       Application available for download from John's blog IG Cookbook with John’s latest tips for IG
-       Resize advanced configure options; globally as well on each column to be declarative in 5.2
-       Context menu on click instead of action row menu
-       Demo on listening to modal changes and acting based on it
-       Ideas to double model same data to compare data or similar
-       Example of Split grid in form multi view demo
Normal form populated with DA by subscribing to changes on modal grid; extra option is multiple selections and editing
-       Awesome example of IG customization of detail view being a standard view and changing to use Card templates with changes to buttons
-       IG API documentation will be included
-       Select cell range copy down or copy to clipboard functionality to be added


Other features

-       New property panel search functionality that will search all fields and values
-       Exposing advanced calendar configurations (FullCalendar)
-       Blueprint and Features functionality to help you build your apps
-       Interesting was a mention of further improvements on APEX “talking” to external REST APIs.

Other speaker tips:

-       Great intro session by P. Raganitsch for all who want to dig deeper into Electron JS; installation and features like reading system files or access to printing engine

-       When building your apps make sure your CSS scripts are loaded before JavaScript as this puts importance on visual over functional part of your page first

-       If you are not using region caching, maybe time to consider learning about this great feature; great tip is to display date region last refreshed using apex_util.cache_get_date_of_region_cache

-       Ever had problem with LOV reloads when your page are loading – loadash.js library to the rescue. It can help you control number of reloads needed when cascading LOVs are involved

-       Using substitution strings in your query like &SESSION. Performance wise it is better to use concatenation. -> ‘f?p=……’|| :SESSION

-       apex_debug.log_debms_output outputs all dmbs_output in your session

-       Everyone is talking about Docker – great tips from Roel H. on how to setup one for your APEX environments and things you need to know

-       If you ever hit limitations with JSON size when working with images check out Dimitri’s presentation on Java from 12.2 database and all the tips here using Nashhorn

-       One of my favourite was Simon’s Hunt – Automated testing framework demonstration session; if you ever wanted to do testing right and simple definite worth checking. We still have to see how this will work out but thumbs up for making this available to the community 

-       I have to mention great APEX Nitro please check more details on OraOpenSource. Great way to speed up you development work

-       APEX Generator; awesome idea how to optimize your project work by rendering your apex pages directly from PL/SQL; another great work by friends from MT-AG; look forward when this will be publicly available to try it out

-       Good practice is to document your PL/SQL work so why not use https://github.com/OraOpenSource/plsql-md-doc



For last something we all need that was demoed by Joel Kallman from APEX team is Quick SQL sample application. It is now so easy to create dummy data or mock-up models for your applications. Please check sample packaged applications and you will never look back.


To summarize, I know I will see you next year in Orlando for KScope18. 

Thanks to all who made my stay in San Antonio so great. 


Happy Apexing,
SLino 

In case you missed it, you can join ODTUG and view all recorded sessions online otherwise join us for free AUSOUG 2017 webinar series with some of KScope17 presenters.