Auto-close iFrame causes timeout error


#1

Hi, I have the following situation with Kantu-Extension for Chrome on Mac

  • Click link: iFrame Opens
  • selectFrame index=1
  • Click button: iFrame Closes
  • selectFrame: relative=top (script timesout)

It’s a bit inconsistent, but it appears that if the iFrame is removed from the DOM before the “selectFrame: relative=top” fires, then it causes an error. Is there any way around this? I have tried refresh, selecting window etc etc.

This following script recreates the error:

{
“CreationDate”: “2018-9-23”,
“Commands”: [
{
“Command”: “open”,
“Target”: “https://apex.oracle.com/pls/apex/f?p=23908”,
“Value”: “”
},
{
“Command”: “type”,
“Target”: “id=F4155_P1000_USERNAME”,
“Value”: “test”
},
{
“Command”: “clickAndWait”,
“Target”: “id=LOGIN_BUTTON”,
“Value”: “”
},
{
“Command”: “click”,
“Target”: “//*[@id=“288717661996272463_orig”]/tbody/tr[3]/td[1]/a/img”,
“Value”: “”
},
{
“Command”: “selectFrame”,
“Target”: “index=0”,
“Value”: “”
},
{
“Command”: “click”,
“Target”: “id=P2_TEST_NAME”,
“Value”: “”
},
{
“Command”: “type”,
“Target”: “id=P2_TEST_NAME”,
“Value”: “test3”
},
{
“Command”: “click”,
“Target”: “id=P2_TEST_TYPE”,
“Value”: “”
},
{
“Command”: “type”,
“Target”: “id=P2_TEST_TYPE”,
“Value”: “test4”
},
{
“Command”: “click”,
“Target”: “id=P2_TEST_CATEGORY”,
“Value”: “”
},
{
“Command”: “type”,
“Target”: “id=P2_TEST_CATEGORY”,
“Value”: “test5”
},
{
“Command”: “click”,
“Target”: “id=P2_TEST_DESCRIPTION”,
“Value”: “”
},
{
“Command”: “type”,
“Target”: “id=P2_TEST_DESCRIPTION”,
“Value”: “test6”
},
{
“Command”: “click”,
“Target”: “id=B288726381496272473”,
“Value”: “”
},
{
“Command”: “selectFrame”,
“Target”: “relative=top”,
“Value”: “”
},
{
“Command”: “click”,
“Target”: “id=R288717572237272463_search_field”,
“Value”: “”
}
]
}


#2

So it sounds like the issue is that

  • sometimes the iframe is there, then you need SelectFrame
  • sometimes the iframe is not there, then you do not need selectframe?

If so, have you tried wrapping the command in !errorignore statements?

store | true | !errorignore
selectFrame | relative=top 
store | false | !errorignore

With !errorignore = true the macro recovers after an error and continues.


#3

Thanks for the reply, but I cant get that to fix the problem, it still times-out when trying to selectFrame:relative=top. I guess that having errored it still has focus in the iFrame, so ignoring the error will have no affect. I have added a pause to the script to get it to fail more consistently (see below).

If I follow your logic then it should actually work by just pausing till the iFrame disappears and removing the selectFrame:relative=top altogether. Unfortunately, it looks to me that if the focus is in the iFrame when it disappears then Kantu ends up in limbo with no way to get back to the parent frame or window.

{
“CreationDate”: “2018-9-23”,
“Commands”: [
{
“Command”: “open”,
“Target”: “https://apex.oracle.com/pls/apex/f?p=23908”,
“Value”: “”
},
{
“Command”: “type”,
“Target”: “id=F4155_P1000_USERNAME”,
“Value”: “test”
},
{
“Command”: “clickAndWait”,
“Target”: “id=LOGIN_BUTTON”,
“Value”: “”
},
{
“Command”: “click”,
“Target”: “//*[@id=“288717661996272463_orig”]/tbody/tr[3]/td[1]/a/img”,
“Value”: “”
},
{
“Command”: “selectFrame”,
“Target”: “index=0”,
“Value”: “”
},
{
“Command”: “pause”,
“Target”: “1000”,
“Value”: “”
},
{
“Command”: “click”,
“Target”: “id=P2_TEST_NAME”,
“Value”: “”
},
{
“Command”: “type”,
“Target”: “id=P2_TEST_NAME”,
“Value”: “test3”
},
{
“Command”: “click”,
“Target”: “id=P2_TEST_TYPE”,
“Value”: “”
},
{
“Command”: “type”,
“Target”: “id=P2_TEST_TYPE”,
“Value”: “test4”
},
{
“Command”: “click”,
“Target”: “id=P2_TEST_CATEGORY”,
“Value”: “”
},
{
“Command”: “type”,
“Target”: “id=P2_TEST_CATEGORY”,
“Value”: “test5”
},
{
“Command”: “click”,
“Target”: “id=P2_TEST_DESCRIPTION”,
“Value”: “”
},
{
“Command”: “type”,
“Target”: “id=P2_TEST_DESCRIPTION”,
“Value”: “test6”
},
{
“Command”: “click”,
“Target”: “id=B288726381496272473”,
“Value”: “”
},
{
“Command”: “pause”,
“Target”: “1000”,
“Value”: “”
},
{
“Command”: “selectFrame”,
“Target”: “relative=top”,
“Value”: “”
},
{
“Command”: “click”,
“Target”: “id=R288717572237272463_search_field”,
“Value”: “”
}
]
}


#4

Bump. This is a real show stopper for me, does anyone have any other suggestions. I really like the look of Kantu and everything else is working great.


#5

Hi, is there any change you can give us a login to the website so that we can try to recreate the issue? Without that, it is difficult to suggest a workaround. (If possible, you can send the login details directly to us, just mention this forum post in your email)

But also: We have an upcoming new XClick command that will solve this issue for sure, at it works on the operating system level, and thus iframe or not do not matter to it :grinning: This feature be available in October, and first announced on the beta list.


#6

Sure, it’s all in the script above.

go to: https://apex.oracle.com/pls/apex/f?p=23908

Then just enter a value for the session username.


#7

ah, ok!.. I will test more and get back to you.


#8

Have you been able to access the environment and reproduce the issue?


#9

Thanks for the very good test case! When I run your example I get the [error] csPostMessage: timeout 60000 ms error.
=> it seems once the dialog closes, kantu loses contact with the webpage.

This is a bug, and I created a ticket for it. So if you can, please keep this Oracle Apex test app available for a few more weeks - thanks. => in the next post I will describe a workaround :wink:

error1

test macro (with the “” fixed):

{
  "CreationDate": "2018-10-3",
  "Commands": [
    {
      "Command": "open",
      "Target": "https://apex.oracle.com/pls/apex/f?p=23908",
      "Value": ""
    },
    {
      "Command": "type",
      "Target": "id=F4155_P1000_USERNAME",
      "Value": "test"
    },
    {
      "Command": "clickAndWait",
      "Target": "id=LOGIN_BUTTON",
      "Value": ""
    },
    {
      "Command": "click",
      "Target": "//*[@id=\"288717661996272463_orig\"]/tbody/tr[3]/td[1]/a/img",
      "Value": ""
    },
    {
      "Command": "selectFrame",
      "Target": "index=0",
      "Value": ""
    },
    {
      "Command": "pause",
      "Target": "1000",
      "Value": ""
    },
    {
      "Command": "click",
      "Target": "id=P2_TEST_NAME",
      "Value": ""
    },
    {
      "Command": "type",
      "Target": "id=P2_TEST_NAME",
      "Value": "test3"
    },
    {
      "Command": "click",
      "Target": "id=P2_TEST_TYPE",
      "Value": ""
    },
    {
      "Command": "type",
      "Target": "id=P2_TEST_TYPE",
      "Value": "test4"
    },
    {
      "Command": "click",
      "Target": "id=P2_TEST_CATEGORY",
      "Value": ""
    },
    {
      "Command": "type",
      "Target": "id=P2_TEST_CATEGORY",
      "Value": "test5"
    },
    {
      "Command": "click",
      "Target": "id=P2_TEST_DESCRIPTION",
      "Value": ""
    },
    {
      "Command": "type",
      "Target": "id=P2_TEST_DESCRIPTION",
      "Value": "test6"
    },
    {
      "Command": "click",
      "Target": "id=B288726381496272473",
      "Value": ""
    },
    {
      "Command": "pause",
      "Target": "1000",
      "Value": ""
    },
    {
      "Command": "refresh",
      "Target": "",
      "Value": ""
    },
    {
      "Command": "comment",
      "Target": "relative=top",
      "Value": ""
    },
    {
      "Command": "click",
      "Target": "id=R288717572237272463_search_field",
      "Value": ""
    },
    {
      "Command": "click",
      "Target": "id=R288717572237272463_search_field",
      "Value": ""
    },
    {
      "Command": "type",
      "Target": "id=R288717572237272463_search_field",
      "Value": "dddd"
    },
    {
      "Command": "click",
      "Target": "id=R288717572237272463_search_button",
      "Value": ""
    }
  ]
}

#10

Workaround: Since the website connection is lost “tricks” like the refresh command can not help. But what helps is splitting the task in two macros and combine them in a test suite.

  • First macro: Everything until selectFrame | relative=top (which is no longer needed)
  • Second macro: Whatever you want to do afterwards :wink:

So the first macro stops after the dialog is closed, and then the second macro takes over.

Screencast (Youtube): https://www.youtube.com/watch?v=b5LujAm__jU


#11

Hi, that is great news thanks.

Unfortunately the work-around wont work for me as I use an APEX based testing framework to generate the scripts and then run them locally using browser extensions. Updating the framework to delivery multiple scripts would not be worth it if there is a fix in the pipeline. I can continue to use the old Selenium IDEv2 for the time being until your fix is released.

Shunt