I trigger a click on a button which then opens another window (which is neither a new browser nor a frame).
In the new window I wish to click a button but my code is not triggering the click.
I tried to switch to keyword matching but it is still not working.
My code:
driver.findElement(By.xpath("//span[text()='Continue to General Information']")).click();
…which I am sure is not correct to click the button in the new window.
What syntax should I use to click the button?
You can try something like this:
driver.SwitchTo().Window(driver.WindowHandles.Last());
I found it here. There is bit of an explanation of how it works there.
Related
I have problem clicking the button from VBA using IE.
The page is
http://trademap.org/Country_SelProduct_TS.aspx?nvpm=1|||||TOTAL|||2|1|1|1|2|1|2|1|1
All button I can click, and works fine except Previous/Next period
The control ID is ctl00_PageContent_GridViewPanelControl_ImageButton_Previous
I tried several different methods but nothing worked.
Any help appreciate
Thanks
Is a Javascript controlled button. You will need to use div.FireEvent "onclick" to trigger the event change.
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
I have used the Intellij's tool window as the main frame. On click of a button from the same window, another window (jdialog) opens. When the jDialog box opens, i want to hide or close the tool window. And when the user clicks the stop button in the jDialog box, I want the tool window to appear again.
I have tried to set the visible property to false, like
toolWindow.getComponent().setVisible(false);
This just hides the content, but not the tool window itself.
Can you please suggest me a way to achieve this.
This is how you show/active it:
toolWindow.activate(null);
so hide could be like this:
toolWindow.hide(null);
and close like this:
ContentManager contentManager = toolWindow.getContentManager();
contentManager.removeAllContents(true);
contentManager.dispose();
(but I have not tried it :))
I can't seem to get the Open Panel's New Document button to work. Currently I am just using the default application provided Open Panel (iCloud enabled OS X app) which has a New Document button at bottom left of the window.
However I just get a system beep when I click on it, I would expect this button would do the same as File->New menu option but it does nothing other than beep.
How can I either enable this button to simply create a new blank file or remove it altogether.
Finally I figured it out.
It seems the New Document button is somehow hardware to the CMD+N keystrokes. I had reassigned CMD+N to apply Normal style to text and this breaks the New Document button.
Seems odd that the button is not wired to newDocument method on First Responder rather than to a keystroke combination.
EDIT
I logged a Bug ID# 14886108 and it seems it may be fixed in Mavericks
So I am pretty new to Xcode and Objective C, I've been using it about 2 weeks now. I am building an app for OSX. One of the windows in the app has 5 text boxes, some labels and a submit button at the bottom. The submit button is linked to a method that closes the window, opens a new one and outputs the contents of the text boxes into one text field on the new window.
I had it working correctly, but now when I do anything but click on the top text field the submit method is called and the window closes. I can click on the black space in the window, but click on any of the objects calls the method. Also, pressing tab calls the method. I am not sure when I did to cause this error, but any insight or tips would be very useful.
Sorry if this is vague, I'm not even sure how to describe the problem. If you need any specific information please ask.
Try looking in Interface Builder. Ctrl Click or Right click on the each one of the fields that are responding with calling the function. See if they are linked to the function.
Also check the "responder" as was suggested earlier. You can do this by also right click or ctrl clicking the red responder box labeled "responder". See if anything in there maps to your function