{"id":5606,"date":"2024-02-05T10:47:26","date_gmt":"2024-02-05T09:47:26","guid":{"rendered":"https:\/\/gpmfactory.com\/?p=5606"},"modified":"2024-03-09T09:43:32","modified_gmt":"2024-03-09T08:43:32","slug":"screenshot-automation-for-oracle-apex","status":"publish","type":"post","link":"https:\/\/gpmfactory.com\/index.php\/2024\/02\/05\/screenshot-automation-for-oracle-apex\/","title":{"rendered":"Screenshot automation for Oracle APEX"},"content":{"rendered":"\n<p>Goal: collect screenshots for each page of an Oracle APEX application in order to prepare a user documentation.<\/p>\n\n\n\n<p>I considered a custom developement for automating screenshots but I realized that it was not trivial and I had a look to an online service instead. There are plenty of these kinds of service and I tested the following subset, considering only ones providing a rest API:<\/p>\n\n\n\n<p><\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table><tbody><tr><td>On line service<\/td><td>Basic Plan<\/td><td>Evaluation<\/td><td>Drawbacks<\/td><\/tr><tr><td><a href=\"https:\/\/pikwy.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">pikwy<\/a><\/td><td>3\u20ac\/month + 0,003\/snapshot<\/td><td>Very good<\/td><td>ok with apex.oracle.com but Impossible to access a free tier instance (timeout). Possible to access protected pages.<\/td><\/tr><tr><td><a href=\"https:\/\/apiflash.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">apiflash<\/a><\/td><td>Free with a limit of 100 snapshots\/month (upgrade at 7\u20ac\/month)<\/td><td>Very good<\/td><td>not possible to access protected pages<\/td><\/tr><tr><td><a href=\"https:\/\/www.screenshotmachine.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">screenshotmachine<\/a><\/td><td>Free with a limit of 100 screenshots\/month (upgrade at 9\u20ac\/month)<\/td><td>Very good<\/td><td>not possible to access protected pages<\/td><\/tr><tr><td><a href=\"https:\/\/www.site-shot.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">site-shot<\/a><\/td><td>5\u20ac\/mont for 2000 snapshots<\/td><td>Very good<\/td><td>not possible to access protected pages<\/td><\/tr><tr><td><a href=\"https:\/\/www.url2png.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">url2png<\/a><\/td><td>29\u20ac\/month for 5000 screenshots<\/td><td>not tested<\/td><td><\/td><\/tr><tr><td><a href=\"https:\/\/www.getscreenshotapi.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">getscreenshotapi<\/a><\/td><td>5\u20acMonth for 2500 screenshots<\/td><td>not tested<\/td><td><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>Finally, I realized my prototype with apiflash and I choosed the \u00ab\u00a0Sample Cards\u00a0\u00bb application as a demo case. <\/p>\n\n\n\n<p>It&rsquo;s just a matter of calling the screenshot API for each page (https:\/\/api.apiflash.com\/v1\/urltoimage)  and put the result in a companion able (DEMO_BLOB). cf procedure code after and a sample display app.<\/p>\n\n\n\n<p>Important: The API doesn&rsquo;t deals with authentication, so I set a new scheme at \u00ab\u00a0No authentication\u00a0\u00bb, for the duration of the test, at least, then I switch back to the regular auth scheme. <em>Pickwy <\/em>allows providing credentials, but suffers a specific anomaly in may case (cf above)<\/p>\n\n\n\n<p>Limitations: the modal pages can&rsquo;t be managed this way, except if API gives opportunity to send keystrokes  before, or navigating possibilities.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a href=\"https:\/\/gpmfactory.com\/wp-content\/uploads\/2024\/02\/image.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"643\" src=\"https:\/\/gpmfactory.com\/wp-content\/uploads\/2024\/02\/image-1024x643.png\" alt=\"\" class=\"wp-image-5612\" style=\"width:840px;height:auto\" srcset=\"https:\/\/gpmfactory.com\/wp-content\/uploads\/2024\/02\/image-1024x643.png 1024w, https:\/\/gpmfactory.com\/wp-content\/uploads\/2024\/02\/image-300x188.png 300w, https:\/\/gpmfactory.com\/wp-content\/uploads\/2024\/02\/image-768x482.png 768w, https:\/\/gpmfactory.com\/wp-content\/uploads\/2024\/02\/image-1536x964.png 1536w, https:\/\/gpmfactory.com\/wp-content\/uploads\/2024\/02\/image-2048x1286.png 2048w, https:\/\/gpmfactory.com\/wp-content\/uploads\/2024\/02\/image-200x125.png 200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Sample procedure<\/h3>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">procedure buildscreens (pid number)\nis\n    turl varchar2(2000) := 'https:\/\/api.apiflash.com\/v1\/urltoimage?access_key=   &lt;ACCESS_KEY&gt;&amp;url=&lt;APEX_ENCODED_URL&gt;';\n    l_blob    BLOB; \n    tbody    CLOB;\n    target varchar2(2000);\n \nbegin\n\n    for c in (select page_alias, page_name \n              from APEX_APPLICATION_PAGES \n              where application_id=pid and PAGE_ALIAS IS NOT NULL \n              ) loop\n        target := turl || lower(c.PAGE_ALIAS);\n        l_blob := APEX_WEB_SERVICE.make_rest_request_b( \n            p_url         =&gt; target ,\n            p_http_method =&gt; 'GET'\n        ); \n        insert into demo_blob(image, page_name) values (l_blob, c.page_name);\n        commit;\n        if apex_web_service.g_status_code = 404 then\n          null;\n          -- return '1';\n        end if;\n    end loop;\nend;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Goal: collect screenshots for each page of an Oracle APEX application in order to prepare a user documentation. I considered a custom developement for&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"ppma_author":[150],"class_list":["post-5606","post","type-post","status-publish","format-standard","hentry","category-non-classe"],"authors":[{"term_id":150,"user_id":1,"is_guest":0,"slug":"admin8700","display_name":"Patrick","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/209d5ed69b74d288390621ab4c1d3773?s=96&d=mm&r=g","0":null,"1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":""}],"_links":{"self":[{"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/posts\/5606","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/comments?post=5606"}],"version-history":[{"count":18,"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/posts\/5606\/revisions"}],"predecessor-version":[{"id":5698,"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/posts\/5606\/revisions\/5698"}],"wp:attachment":[{"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/media?parent=5606"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/categories?post=5606"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/tags?post=5606"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/gpmfactory.com\/index.php\/wp-json\/wp\/v2\/ppma_author?post=5606"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}