How to handle browser prompts in Chrome - prompt

I am working with Java application. When i run my script new window is opening with Prompt message as shown in the picture. I want to click HTML5 button it will open Canvas application. I tried Alert & window handling both not working.
How to Click that button through selenium?

Try using this when browser is opened :
Robot robot = new Robot();
robot.keyPress(KeyEvent.VK_TAB);
Thread.sleep(1000);
robot.keyPress(KeyEvent.VK_TAB);
Thread.sleep(1000);
robot.keyPress(KeyEvent.VK_ENTER);
It will perform normal keyboard operations by first going to "Use HTML5" button by pressing "Tab" key and after that it will press "Enter" key.
I do not know if that will help you or not. But you can give it a try.

Related

How do you click a button in a browser popup window

I'm new to using Watir and have a problem. Within my browser page there is an option to add a note. This brings up a window within the browser which has the following id:
span id="ui-id-2" class="ui-dialog-title">Add Note</span
I can't work out how to use the controls within this window such as the 'Save' button as Watir doesn't seem to recognise either the window or the controls
So if I wanted to use same type of Save button within the main browser it would be fine; I'd just use browser.button(:id=> "Save").click.
Trying to use it within the popup though won't work as Watir can't recognise it within the popup. Any ideas appreciated!

How to create dialog for user input in Chrome extension

I'm using contextMenu to run a Chrome extension on some selected text on a page.
When I click on the contextMenu, I'd like to prompt the user for some additional input.
For this purpose, it'd be ideal to popup a window. After the user filled the dialog and click confirm button, I'd like to recuperate the inputs.
Could anyone give me a hint on how to implement this? I've checked the Chrome API, couldn't find anything related.
For the popup dialog, I'd like to put it in the middle of the screen(something similar to Vimium help dialog)

Not able to switch window and shift control to new window in UI automation using WebdriverIO

I am trying to automation of a UI page where, on click of a button opens up another window. I want to switch control to the new window and perform some operation on the new window.
I tried using browser.windowHandles , browser.switchTab(), and browser.switchWindow().
SwitchWindow() helps switching to new window, but control remains in the old window itself.
For example, If I want to perform a click() operation it gets clicked in the older window instead of clicking on the new window.
What method can I use to switch to different window and shift control to new window.

Coded UI Test Builder not recognizing buttons on the pop-up window

When I click the crosshairs icon on the Coded UI Test Builder and drag it over to the pop-up window buttons (Run and Cancel), it is unable to locate and find the Properties of them on the pop-up window.
Does any one know how I can know the properties of the Run button on the pop-up window?
That window appears to be a Java window, which is not supported by Coded UI.
You may be able to extend your tests to interact with the Window:
https://blogs.msdn.microsoft.com/gautamg/2010/01/05/1-introduction-to-coded-ui-test-extensibility/
Alternatively, if you can detect if the window is present, you may be able to emulate the keypresses required to dismiss/approve the window (e.g Enter, or Tab + Enter). Or, if the window's location is predictable, emulate a click at the desired location.

Handling Modal Dialog box from webpage in watir

So I'm writing a watir-webdriver test script, and my webpage is using javascript:window.print to present a modal window that I want to interact with. When I click the link that presents the modal window, watir-webdriver just sits there until eventually it times out and i see a Timeout::Error on the console window. This is before attempting to interact with the new window at all. how do I tell it to move on without waiting?
After that whole execution is not responsive. Its not proceeding with next execution it gets struck there. tried the below solution too
element.focus element.send_keys :return
but no luck, Could anyone know how to resolve this modal dialogbox from webpage.
Thanks
get
I am using Firefox with Watir-webdriver.
browser.a:(:href => 'javascript:window.print()').click
this opens the Print dialog box. Which is the normal print dialog box from teh Firefox browser.
It just waits here and doesn't execute anything after that till i click manually or it timesout.

Resources