Opening Selenium Browser in a JavaFX WebView - selenium-webdriver

I want to know if there is anyway I can open up the Selenium WebDriver in a WebView rather than the default behavior of opening in a new window. If not is there anyway I can get the same functionality (Being able to press buttons, and fill text fields) through the JavaFX WebView.

Related

How to handle this popup in selenium webdriver

How to handle this popup in selenium webdriver
Actually it has only div id. no frame, window names. it's just a modal think.
Trying to click the buttons. But, unfortunately can't get focus of this
driver.findElement(By.xpath("/html/body/div[9]/div/div[2]/div[2]/div[1]/button")).getText();
driver.findElement(By.xpath("/html/body/div[9]/div/div[2]/div[2]/div[1]/button")).click();
Screenshot

Why Sikuli API not able to click Window image for the first time? Works when repeated.

When the file upload window opens, it doesn't click for first time. I close it manually then click again to open the dialog, this time Sikuli proceeds with execution.
Using selenium webdriver to automate file upload with Sikuli API. Please find below code:
driver.get("file:///C:/Users/nitin.chawda/Desktop/example1.html");
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.findElement(By.id("usage")).click();
Screen screen = new Screen();
screen.wait("images\\location1.png",100).doubleClick();
screen.wait("images\\file1.png",100).click();
screen.wait("images\\open.png",100).click();
It's possible that your click is happening the first time, but not doing what you'd expect.
If the window you're trying to click is not in focus, then, rather than preforming some other action, the first click will focus that window, .
Try using the App.focus("WINDOW-NAME"); classmethod before the Sikuli clicks. (where "WINDOW-NAME" is a string matching the name of your file upload window)
Resources:
App Class from Sikuli docs
App Class from the javadoc
just use screen.click(), it will enable the window focused.

How access weblements in a child window in IE8 browser

I am trying to access web elements in a child window in IE8 browser.
I am not able to access any of the element in that child window, I tried Developer tools (F12) in browser, macros to get X path, page source to get ID/name for the elements but nothing is working there. Could some one help me please
What do you mean by :-
nothing is working there?
Be specific.
You can open the website in Firefox or some other advanced web-browser to get the element's selectors and later run the automated scripts using IE 8 driver.
Check the code in the answer provided for a similar question -
Java: focus is not on pop-window during window handling
EDIT: Other approaches--
Try the following steps (Manually):
Open main page, hit F12 to open developer toolbar.
Perform action that opens the popup.
Focus on popup and hit F12. You should see a developer toolbar.
Check this screenshot - http://snag.gy/pPXLX.jpg
As an alternative you may also try getting the URL of the popup and open in a new tab in the main browser window and then do F12 to inspect any elements.

Can Silverlight hook into the browser's Edit > Cut/Copy/Paste menu items?

We have a Silverlight app that contains a grid, and we've added support for selecting multiple cells, copying their contents to the clipboard, and pasting back elsewhere in the grid. Currently the user invokes the Copy and Paste commands by either clicking a toolbar button inside our Silverlight app, or using the standard keyboard shortcuts, which we catch with a KeyDown event.
Is it possible to also hook into the browser's native Edit menu, and the Cut, Copy, Paste, etc. menu items that are built into the browser? For example, can the user drop down the Firefox button (or press Alt+E to drop down the classic Edit menu), click the Copy item in Firefox's menu, and have some sort of Copy command be relayed to the focused control in my Silverlight app? Same thing for the equivalent menus in IE, Chrome, Opera, etc.
I wouldn't be surprised if this can't be done, since even long-established browser plug-ins like Adobe Reader have their own buttons for copy/paste and even print, rather than hooking into the browser's native menus. But I've never programmed to a browser's plug-in model, so I don't know for sure what's possible.

How to force IE7 toolbars to always show

I have the developer toolbar for IE7, which is great when I want to inspect the page layout in a fashion similar to the functionality of firebug for firefox.
However I am working with a web site that opens a new window with the toolbars disabled, and I cannot access my dev toolbar button! Is there a way to force IE7 to always show the toolbar?
I don't believe you can.
You can recover the navigation toolbar (back, forward, address bar, search box) in a chromeless window (one opened without navigation toolbar, menus, other toolbars) by hitting F11, then F11 again, but that still doesn't give you access to the IE Developer Toolbar.
What will sometimes work is to hit CTRL+N while the new, chromeless window has focus. Doing that will open a new chromed (toolbars, menus, etc) to the same URL as the chromeless window. The trick won't work very well if the chromeless window URL is the result of a POST, or does a GET that modifies state in some way on the server.
I imagine that this happens because the pop-up window is opened using a javascript window.open() call specifying not to have the toolbars on the new window?
One possibility is opening the page source, finding the javascript call that opens the window, and pasting it into the address bar, modifying it to not disable toolbars.
For example, if the call currently looks like:
window.open(url, "newWindow", "toolbar=no,width=500,...");
Edit the address bar to read something like:
javascript:window.open(url, "newWindow", "toolbar=yes,width=500,...");
When you push enter on that, it should pop up the window just the same, but with toolbars.
IE8 has the dev toolbar built-in, so you can always access it via F12. Consider upgrading?

Resources