How to inspect an element when right click opens up menu on the site - selenium-webdriver

I want to inspect an element in a website, but when I perform a right click the menu opens up. I dont see an option to Inspect. How can I inspect an element here.
Thank you for the help.

One solution would be to disable Javascript using one of many available plugins.
Another is to simply open developer tools and navigate to that element. There are few ways to do it:
press F12 (Works for Windows, Mac, Linux)
Menu → Tools → Developer tools
press Ctrl+Shift+I (works same way F12)
If on MacOS, press ⌥⌘I
I used this answer for reference, but improved.

Open Chrome DevTools
Command+Option+C (Mac) or Control+Shift+C (Windows, Linux, ChromeOS).
Open the Command Menu
Press Control+Shift+P or Command+Shift+P (Mac).
Start typing javascript, select Disable JavaScript. JavaScript is now disabled.
Now when I right click on the element, I no longer see the Menu option. I can now inspect the element.
To re-enable JavaScript:
Open the Command Menu again and run the Enable JavaScript command.
Close DevTools.
Referenced link

Related

How to keep firefox web extension popup from closing when clicking on inspector window

I'm having a hard time debugging my Firefox extension (popup). Whenever I click on the debug pane, the popup closes and all the information in the debug pane is gone. This happens when trying to inspect the network requests, copy something from the console, or look at the element styles in the inspector.
I'm sure other Firefox extension devs have encountered this problem. How did you solve it?
You can disable popups closing when something outside of it is focused from the add-on debugger toolbox: https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Debugging#Debugging_popups

How to inspect a Firefox WebExtension popup?

I'm trying to get a Google Chrome Extension to run as a Firefox Webextension. My original Problem is that the popup has no height. Besides that I could not for the life of me figure out how to inspect the DOM of the popup.
Btw the popup is just an HTML file and it is defined in browser_action.default_popup.
The bugs referenced in #minj's comment above are resolved in recent versions of Firefox. You can debug popups now. MDN explains it well; in brief...
enter about:debugging in the URL bar.
In the left-hand menu, click This Firefox (or This Nightly).
click Inspect next to your extension to open the "Extension Toolbox".
Check the option to "Disable Popup Auto-Hide" in the Extension Toolbox
then you select which HTML document you mean to debug (in this case it would be your popup HTML code) using the context switcher ("select an iframe as the currently targeted document")
After doing this, the popup stays on the screen and the inspector contains its HTML. I'm doing it now for the first time (in Firefox 49) and it's working well.
It's not currently possible since the popup closes automatically and there is no DOM view available. See bug 1236944 and bug 950936.
Popup sizing does not seem to work correctly in Firefox. There are a bunch of bugs related to it.

How to read source code of a dialog box in Internet Explorer 9

I am automating a web application using ruby and selenium-webdriver which contains multiple fields in dialog boxes. And these dialog boxes contains lot of nested iframes. I am unable to get the element properties using the Developer Tool as everything is disabled for a dialog box. For the time being i am using page_source function of selenium webdriver to read the source but it is of little use in case of nested frames.
Please tell me a good way to identify elements in a dialog box in Internet Explorer
Follow below steps to fix this issue
Open Internet Explorer
Click the "Tools" gear (Alt+X)
Select "Internet options"
Select the "Security" tab
Click the "Custom level..." button
6 .Disable the "Allow websites to open windows without address or status bars" option
Hit OK
Hit OK
Now find a modal window and press F12
Source: http://blogs.msdn.com/b/kurlak/archive/2012/08/27/opening-the-internet-explorer-developer-tools-dialog-on-modal-windows.aspx

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.

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