How to click on "Stay on this page" button on confirm Navigation pop-up when i moved one form to other form without save entered value in selenium - selenium

In my application,when i enter some values in available fields and without click on save button if clicked on other available form tab than comes a confirm Navigation pop-up which have buttons "Stay on this page" or "Leave this page".
I have to click on "Stay on this page" button and than click on submit button.
I tried with Alert class alert.dismiss(); which closed pop-up but i want to click on "stay on this page" button.
Can anyone please help me to do this thing in selenium .
When I move from one page to other without clicking on save button i got this confirm Navigation pop-up:

I Hope this will work, First you need to switch on that alert
Alert alert = driver.switchTo().alert();
and then change focus to Stay on this page tab
alert.sendKeys(Keys.chord(Keys.TAB));; //By pressing TAB key in this way
and then click the button
alert.dismiss();
This approach is working at my end

Related

robotframework- unable to click a button on a modal dialogue box

when I open a particular webpage it has a EULA form that appears on top of the home page in the form of a modal in HTML/CSS. I have tried the XPath of the accept button but it says element not found also tried using handle alert.
is there a unique way to handle a dialogue box in robotframework?
image of HTML in inspect view
SeleniumLibrary.Set Focus To Element ${button_on_popup_page}
SeleniumLibrary.Click Element ${button_on_popup_page}
I figured it out, shown in the above code. I first set focus to the button and then used the click element. This seemed to work.

How to add a onclick pop up form on a page?

When someone clicks on a button then a pop up form will appear.
I am trying to do but don't know how to fix it.
You can open new popup window form by javascript as you have to
call following with onclick event of your button
window.open(url, 'new tab', 'width=700,height=500');
You can also close this popup window after success of form submission by following
window.close(url);
In url you have to add your url.
If this is not work please share more information. thank you

I am having trouble while clicking a "Submit An App" button on my application which is present on the Menu bar

I am using the below code for this, this is present inside a frame and this also clicks the button but after button is clicked the control is lost. The possible reason i see is the page lands on same page which extra options after the "Submit An App" button is clicked.
I am using c# to code it. The first line finds the button the second line clicks but go for a timeout. I have seen this behavior fist time not sure how to work it out.
IWebElement field = VelocityDriver.FindElement(By.Id("AppSub"));
SeleniumExtensions.ClickElementAndContinue(field);

I have to maxmimize the child page minimized when it double clicked on its parent page. Is this possible to work in webform in vb.net

I had a page with gridview when clicking on the hyperlink in the cell it will open a popup window.
When this popup is minimized I was not able to click anything on the parent page so I need when I double click of mouse on parent page I want this popup to be maximized. And I was not even able to open new tab also when popup is minimized .so new tab also have to be opened when popup is minimized I dont want to use any extra buttons in my design.

dojox form uploader button is clickable only on the border, but not on the full button

I am using IE8
I have created dojo button as below
It has displayed button "Select Files".
Problem
When I click on top border of button its working fine. When I click on any other places on button file picker dialogbox is not displaying.
When I right click on button and select zoom in option once, I am able to click on all the coordinates of button(after selecting zoom option, it works similar to html button).
Note: I have used flash for multiple file selection.
Please tell how to make this button work by clicking in any place.
Have you checked if there is other element's borders in front of the button? Try to check with the developer tools option activated on your browser and select "inspect element" (or similar). If another element is detected when you hover over the button, you have your answer.
Apart from that I have no more ideas.