However, that thread appears to have never been resolved.
What kinds of situations would cause selectWindow to open a tab twice? Is it a timing issue that putting a pause before or after might fix? Or is there a waitfor or onEvent sort of command I can use as a remedy?
Or can someone lead me to a way in my script to detect how many tabs are open so that I can use selectWindow | tab=close to close the extra tab?
The problem I had with the Open command is sometimes the macro stops because of something like “no page load event”. And yet the pages loaded fine. I did overcome this Open command problem by setting !errorIgnore to false.
When use command open add wait 60000 (1 minutes) to give time to load the site, I usually give from 1 to 3 minutes of time to be sure that the site has been fully loaded.
You can combine with this command to waitforpagetoload (this usually detect correct time of loading of page) i combine waitforpagetoload and wait, if the first command waitforpagetoload fails the is second command wait to add a delay in open command.
I’m glad you included the link. Clicking the link caused me to look at the waitForPageToLoad command a second time. I see that I missed an important detail that you can specify a wait time.
In my case, I see the page load. Then I see waitForPageToLoad timeout after the default timeout of 60 seconds. About three months ago, the website with which I am dealing with actually did need up to 3 or more minutes to load, and even then, the load would often stall out. That was before I had even heard of UI.Vision Kantu. That website has really pepped itself up. The pages are loading fast. I can see how the page could have 2 page load events before it is fully loaded because the source has iframes. I’m guessing that (as described in waitForPageToLoad) this website can have the 2 or more page load events too close together for Kantu to detect both every time.
What could be happening is: I issue the Open command. Then after 0.8 seconds (for instance), the server already responds. I get the first page load event which allows Kantu to go to the next command, waitForPageToLoad. If Kantu gets to waitForPageToLoad in time, then it detects the second page load event. Otherwise waitForPageLoad misses the second page load event and times out.
But anyway, doesn’t matter because my making use of the practical information you’re giving me has made my script much more solidly reliable.
@Indinfer How are you starting the macro? I had the same issue but only when starting from the autorun HTML, which I believe is by design because you can’t start from a new tab page. I use selectWindow tab=0 and then open so you use the same newly opened tab.
User9898,
The double tab-opening was without starting from the autorun HTML. But what I am probably doing different that causes the double-tab opening is that I am opening the same URL many times.
Thank you, newuserkantu, my applying your hints has helped my scripts to work more solidly.
What type of firefox do you use ? (installed or portable)
What version of firefox do you use ?
What version of ui vision Kantu do you use ?
Currently I use firefox portable ESR 60.9 with Kantu 5.1.9 and this problem no longer arises, before I used firefox ESR portable 68 with kantu 5.1.9 and I had your same problem, I had to use an old version of firefox just because of the problem that it happens to you that did not allow me to work now it never happens that opens me 2 times the same firefox tab.
I think this problem may be an incompatible quantum engine of firefox because I noticed that some times if you manually click a link can open 2 tabs, also does not happen with all versions of firefox
I’m using installed Firefox 70.0.1 (64-bit),
Kantu 5.2.3. I don’t know where to check for a later version.
I have not noticed the double tabs. But now it is less likely that I would notice because I’m coding
selectWindow | tab=closeallother
in a few places. This works well enough for me so far.
I’m trying to download about 30 data files. The problem I’m having is sometimes a file is skipped and sometimes the same file is downloaded twice.
Possibilities I can think of:
My code actually skips the files. I’ve been checking but have not yet found any files missing in my code. But maybe I will see it later.
A timing problem. Maybe my code is hitting the website too fast. Before the website downloads one file, my code is already requesting the next file. I got some improvement by putting some pauses for 5000 ms.
Maybe something is not getting cleared between files. I have one case in which a file is downloaded twice. First time is when it is supposed to download, and the second time is instead of the next file.
For now, the double tab openings are not concerning me.