My app behave like this:
Add items -> user clicks Add button -> app return to main page
IF there are too many items, after user clicks Add button -> new dialog prompt 'waiting...', then user click OK button -> user click send button again
it is a loop if the new dialog prompt after send button is clicked. (from manual testing, this dialog could appear 2-3 times only).
I have written test case after click add ->
if there is dialog appear then click ok -> click add -> back to mainpage.
it is working fine when the new dialog appear.
I noticed if the new dialog does not appear, ROBOT still proceed to the ${VERIFIED} lines....this causing the script pausing for quite sometimes. no error but how do I get rid of it?
However the application may prompt the dialog many times when server loading is slow.
I want robot press this ok whenever dialog appear again then click add.
How do I achieve it?
Add Item
Click Add
${VERIFIED} Run Keyword And Return Status Wait Until Page Contains Element ${ANDROID-WIDGET-TEXT-VIEW}\[#text='Please wait'] 3s
Run Keyword If ${VERIFIED} Wait Until Page Contains And Click ${ANDROID-WIDGET-BUTTON}\[#text='OK']
Run Keyword If ${VERIFIED} Click Add
Wait Until Page Contains Navigation Bar Title MainPage
Related
when a user click the apply for a job button-
an apllication form pop up is dispalyed.
if the user does something wrong like dont filling a require field - the popup is close (application not sent!) and alert is being displayed on the top of the job page.
expected:
popup should not close. alert is displayid on that pop up.
i am using the joibfy theme
here is a link to a job for example:
https://jobs.kedemcenter.co.il/job/%D7%A7%D7%93%D7%9D-%D7%94%D7%A9%D7%9E%D7%95%D7%AA-%D7%A8%D7%90%D7%A9-%D7%94%D7%A2%D7%99%D7%9F-2-%D7%93%D7%A8%D7%95%D7%A9%D7%94-%D7%9E%D7%AA%D7%9E%D7%97%D7%94-%D7%90%D7%95-%D7%A8%D7%95%D7%97-%D7%9C/
My work is to watch videos, select some options and then press the "Submit" button. The thing is that the options I have to select are on the left side of the webpage and the "Submit" button is on the right side. I think I will be able to do my work faster if I can make a keyboard shortcut to press the "Submit" button. I somehow built this code
var button1 = document.getElementById("_SSsubmit");
window.addEventListener('keydown', function(e) {
if (e.altKey == true && e.keyCode == 83)
button1.click();
});
I put it in Chrome's Developer Tools Console and it works only 1 time. The next time when I press "Alt + S" - nothing happens. Is there a way I can make it work while the tab is opened?
The event listener itself will trigger multiple times so long as the page isn't reloaded, you can test this by replacing the button1.click() with a simple console.log(). It seems to me that either:
a) the page is being reloaded every time you submit, in which case you would need to paste the code into the console every time the page loads or
b) the submit button element is getting replaced with a new element each time, in which case you would need to re-assign button1 every time. Most likely, the page is being reloaded.
In either case, your best bet here is probably writing a small Chrome extension so that you won't need to keep pasting code into the console.
Scenario:
Enter a keyword (Position) in a textbox
press Tab or click on the next element
A window popup appears
a list of position matching the criteria will be listed
click the required record
Popup window closes automatically
Alert will be displayed
have click on ok button of alert.
switch to main window and check the position details
Question :- i found many solutions in the site but all are about performing actions on window popup and close the popup then switch to alert or main browser
but my application closes the popup window automatically after selection,hence i cannot use the driver.close() or driver.switchto.defaultContent().
If i dont close the driver (for popup) im not able to identify the next alert displayed after popup.
if i switch directly to mainwindhandle, the alert dismiss is happening instead of accept.
Please anyone who know how to switch from window popup to alert without popup close help is needed...
Thanks ....
If alert dismiss is happening when you are trying to accept it, why don't you use alert.dismiss(), it will probably accept the alert in your context.
When you switch to the popup window, the driver focus is on the popup window. What you might want to do is, just after clicking the required record, switch to the main window then accept the alert.
This must be helpful for you . From your questions, Even after your pop up closes automatically you must be able to access your parent window element by switching back to it. There is no need of driver.close() all the time. Here is the code,
// do something with the pop up and it closes automatically here.
driver.switchTo().defaultContent();
driver.switchTo().frame("your parent window mainframe"));
// try to access your parent window element here
I have a scenario where...
1.) Have created a div with a dropdown list and ok, cancel button
2.) On document ready - registering div created on step 1 into a jQuery dialog
3.) on a javascript button click - I am opening this dialog box.
4.) Now, the problem is - the jQuery dialogbox which I have created, needs to be used by other button clicks as well on same page. Now, my div's (which is a dialog at runtime using jQuery) ok button click is already engaged with a javascript function (button1 click) and I can not associate other button's click events with it - thus stuck up here and have no clues or hit to resolve this.
Anyone have faced this issue in asp.net, jquery earlier? Can someone provide a guidance?
Why you cant associate another event?
buttons will have different id. Is it?
$('#button1').click(function() {
alert('Handler for button 1 .click() called.');
});
$('#button2').click(function() {
alert('Handler for button 2 .click() called.');
});
Is this not possible in your case.?
Options:
1) disassociate the click handler when the function opens the div, then later in the function of opening the div associate a click handler to the button.
2) create multiple buttons toggle them all hidden, associate the click handler to each button you want. When the div is opened do a check to see which button to toggle to visible.
3) create no buttons but have a function create the button on the fly. When the div is opened, create the button for that div by calling the function and passing in a code telling it which button to open and what to associate to the click handler (this can be stored in an array and all that is passed in is the key).
Depending on the application, I have used all of these methods. The last one can have a twist that allows it to call an ajax server based application to get the button text and functionality (stored in a database), this saves you from having to load an array with button data, and also allows for easier expansion of the application.
I created a Button in MXMXL. On button click, I create a Menu as a child of the Button. I am using an XML datasource. The reason for creating it this way, was due to the amount of custom skinning involved. A popupmenubutton was not an option. Anyway, so my question is this: when clicking the button, the menu is displayed. However, if you click the button again, the menu reopens. I want the menu to close if the user clicks the button a second time. Now, I got it to work by setting a var after opening the menu, and then I check that var on each click to make sure that the menu isn't already open. If true, then it will close the menu, instead of reopening it. This works, until the user clicks away, in which the HIDE event gets dispatched and the menu closes. My hack no longer works.
Any suggestions? I spent hours trying different things. The hardest part is trying to destinguish from that second button click when the menu is open, and when the user clicks away from the menu. They both dispatch the HIDE event.
Help!!!
Have you tried adding another eventlistener to the button...FlexMouseEvent.MOUSE_DOWN_OUTSIDE ? You should then be able to set the preventDefault event to true to stop the event from firing anything else and stop the menu from closing.