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

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

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 handle modal/ pop-up using automation

Tried to handle the pop-up many ways, need clarity do we need to change the body. because when the pop-up is displayed the new class is adding it is as below.
https://i.stack.imgur.com/jQC2B.png
The actual Pop-up class is as below. there is no close button for this pop-up.
https://i.stack.imgur.com/e1ZWc.png
-By manual user can close the pop-up when user click any where in the page. When i tried click any where using automation it is displaying as element not found
Here is the code i user to handle the pop-up i am so confused how to handle the pop-up
https://i.stack.imgur.com/ibf0j.png
Thanks for help in advance
please try to check the javascript from where this pop-up is executing and try to disable display property by setting it to none
Try to remove this div class name "_355Q0" from DOM. by using this javascript query.
var myobj = document.querySelector("._355Q0")
myobj.remove();

Can't click button using InternetExplorer.Application

I'm trying to click the "Continue" button programatically using the InternetExplorer.application object on the page "http://www.dallascounty.org/criminalBackgroundSearch/". When I click the button, nothing happens.
Below is my code:
loie = CREATEOBJECT('internetExplorer.application')
loie.Navigate2('http://www.dallascounty.org/criminalBackgroundSearch/')
loie.Visible = .T.
loSubmitButton = loie.Document.getElementsByName('Submit')
loSubmitButton.item[0].Click()
Until about a week ago, the button was clicking with no problem. I realize there is also a capatcha on this page, but even if a manually click the "I am not a robot" box, I still can now programmatically click the "Continue" button on the page. Could somebody please tell me what this site did to their page that is preventing me from programmatically clicking buttons and how to get around it?
I also would like to get passed that captcha programmatically, but that is a separate problem which I will deal with later. However, if anybody has any tips on how to get passed that captha as well, I would be greatful.
Thank you

Add help button to form

I have a form with minimize/maximize buttons on the toolbar so I cant have a help button there.
So I thought I would add a normal button and add code on the click event to show the help cursor and show the help text on the controls exactly as the help button does on the toolbar.
I can change the cursor to show the question mark but this doesn't do anything else, how can I 'activate' the help function?
You first have to create one, have a look at the Helpprovider class:
Msdn HelpProvider class
HelpProvider example
But, you can also create a simple form, add a webbrowser control to it. Then create a .html file and insert it in the webbrowser control, when the user clicks the help button, the form will open with the .html page with your help text.
You can set a shortcut in the property's window for the button that opens the helpfunction like this:
The F1 button will call the code behind the helpbutton that calls the help function.

Modal Window Problem

I am using modal window for my VB.NET program and i am trying to open this child modal window from another window, afte i close the child modal window i am trying to refresh the parent but i am getting retry/cancel popup, i tried a lot of things to avoid but i can't get rid of this popup :-( is there any way i can avoid this popup? I would really appreciate your help
Thanks
Faisal
Did you tried to bind an OnClickClient javascript function to the button who close the modal popup to manually call a PostBack to the server ?
function fnClickOK(sender, e) {
__doPostBack(sender,e);
}
that's the function you must include in your code and you can bind the button in the code behind like that
yourButton.OnClientClick = String.Format("fnClickOK('{0}','{1}')", yourButton.UniqueID, "");
Like that, the postback should occur and because of the page reload all Modal will be hided.
Good Luck!