I have an excel macro that enters data into a web-form (usng selenium and web driver). After each submission (by clicking submit button), a popup appears and the macro clicks OK on that alert by running this code lineobj.SwitchToAlert.accept to continue the loop . Entire code is working fine. Only problem is sometimes the alert takes 5-10 seconds to appear. That time the code proceeds to click the button and gives error (as no alert pop up is present yet).
Is there any way that macro can wait until the alert is present before running obj.SwitchToAlert.accept?
There are additional parameters in the SwitchToAlert method that you have overlooked.
The one in particular is the Optional Timeout As long = -1 parameter. Set this to a value, such as 20. This means it will wait a maximum time of 20 seconds for your alert to appear, then click accept. If it appears in 5 seconds, you only wait 5 seconds (not the full 20).
obj.SwitchToAlert(20).accept
Would be the line you are wanting to use.
When you are using the default value of -1, you are telling this method to use the global default timeout, which is 5 seconds. You can change this global value by changing the obj.Timeouts.ImplicitWait property.
Related
Is there any way that we can scroll down in a webpage till an element where we want any verification or want to enter values ?
Another question is that I used global send keys to scroll a page. It works in object studio if I provide an interval of 0 (as inputs set tends to Yes), but from process studio I get an error as follows
"Internal : Failed To perform Step 1 In Navigate Stage 'Trying scroll' on page 'Select hotel' - Special characters (~{}+^%) are not supported in SendKeys if an interval value is provided. Separate calls can be used to send control characters."
how to overcome such situation ?
Try removing the interval = 0. If this doesn't work, can you please share a screenshot of your action inside the object and the Navigation stage that you are using to send keys?
I have created an Xpages then put a editbox in it.
editbox has typeahead functionality. but some time It takes more than 5 seconds options to appear on editbox. During this 5 seconds i just want to make a loading progress screen on editbox or next to editbox.
is there any way to do this? any thought is important.
Thanks in advance
You can call a JavaScript function as soon the partial refresh of the typeahead is fired. A script to hijack the call can be found here: http://hasselba.ch/blog/?p=416
A timer can wait for a specific amount of time (e.g. 1 second), and then show a progressbar if the refresh is still running. If the call is completed hide the image.
Feel free to create a snippet of your solution and post it as a XSnippet.
I currently have a pop up that shows in my app in which users have to enter data.
I want a 5 minutes timer so after this time, if they did not fill out the data, the pop up will close.
Basically, after 5 minutes, I want a certain method of the bean to be called, which will as a result, close the pop up.
I know how to call the action on the bean, but I can't find any info on how to create a timer, and display it in the pop up. I need the user to be able to see the remaining time.
I currently have a <rich:modalPanel> in order to display the pop-up.
Is this only possible?
I am trying j2me code in which i am putting to thingd a alert message and setCurrentItem()
function..
display.setCurrent(alert);
display.setCurrentItem(textBox)
the problem is that before we can see the alert msg it disappear and because of display.setCurrent(textBox). what should i do to see the alert message correctly and than move to the item which is placed im display.setCurrentItem??
I don't really do any High Level GUI coding (meaning Form stuff), so I'm no expert.
But looking at the docs, I can see a setTimeout(int time) function on the Alert object.
So my guess is that you should display the TextBox first, and then display the Alert afterwards with a timeout.
alert.setTimeout(5000); // 5 seconds
display.setCurrent(textBox);
display.setCurrent(alert);
That should display the alert for 5 seconds, and then when dismissed, the textBox should appear.
Looking at the Display object, I also notice another function called setCurrent(Alert alert, Displayable nextDisplayable) though, which seems to be even better.
Using that method you should be able to just do
Display.setCurrent(alert, textBox);
The docs says the following about that method: "Requests that this Alert be made current, and that nextDisplayable be made current after the Alert is dismissed. This call returns immediately regardless of the Alert's timeout value or whether it is a modal alert. The nextDisplayable must not be an Alert, and it must not be null."
Bookmark and use this page a lot:
http://docs.oracle.com/javame/config/cldc/ref-impl/midp2.0/jsr118/
Today we encountered a strange problem.
We have a XPage with some buttons, who id opened in editMode and bind to backend Notes Document.
We can press the buttons and the values are updated to the backend document. Via a partial refresh we see the new values.
So far so good.
But.. when we leave the XPage open for, let say 1 minute, without doing anything. After this period we try to click a button, we noticed that the button became unresponsive.
Is there a cause for this behaviour??
Never seen it happen in a minute, but there is a timeout setting in the server INI that defaults to 30 minutes, I think.
I see the same problem, but, not after a minute, but a few hours. I have an onclick event tied to a radio button and after a period of time, if I return back to browser clicking on the radio buttons does nothing...
Have you tried:
https://openntf.org/XSnippets.nsf/snippet.xsp?id=extend-partial-refresh-timeout
XSP.submitLatency = 120*1000;