See CSS of :after activated on hover in dev tools - google-developer-tools

In Google developer tools A website applies an :after only on hover.
Therefore, when I hover on an element I can't move my mouse to the :after in dev tools to see the css.
Is there a way to pause on hover in dev tools?

You can pause various states of an element by going to "elements tab" and selecting the element in question in the DOM tree shown.
Click ":hov" and select the state you want the element to be in.

Related

How to inspect an element created dynamically in the DOM for karate testing

I’m working on an application that allows you to enter an automatic date. To test this application, I must follow a scenario that allows to select a specific date (e.g: 15/12/2021) by clicking on it.
For this I use a datepicker from the bootstrap library.
datepicker
But it is impossible to inspect this element, because, once displayed, it disappears with the slightest mouse click in the window, so that when I right-click on the datepicker to inspect it I lose the focus on the element that disappears.
Here's the inspector (when I want to open the div, the datepicker disappears):
inspector HTML code
How could I inspect this datepicker to create selectors?
Best regards
Use Chrome:
1. Right click Inspect
2. Go to Elements tab
3. Click on datepicker element (and watch what element is highlighted in the Elements tab)
4.Right click on that element in Elements tab and select Brake on - one of the options should work
5. Click on that datepicke element and Debugger should start
6. Click on Play until Your element is loaded
7. Inspect
For example:
Go to google.com
To inspect google apps selection:
1. Inspect page and switch to Elements tab
2. After clicking App selection button you will see that class="fade-in" is highlighted
3. Right click on this element in Elements tab and select Brake on - > attribute modification
4. Click on App selection again and You will see debugger appear
https://ibb.co/D7V3P3C
5. Click on Resume script execution but in the Inspector (Red bounding box on the pic) not on Debugger in main screen, until App selection is not showed
6. Then You can inspect Apps as You wish
You could also use EventListeners to set break on them.

Inspect Element shows elements for just a few seconds before all of the rows collapse

It was suggested that this had already been answered and then my question was closed.
I've looked at all of the links and I don't see an answer there. Please don't close my question unless you're absolutely sure it's been answered.
Why XPath does not highlighted the yellow mark in Chrome84? (2
answers)
Chrome 84 Inspect element, find results not highlighted in
yellow like before (6 answers) Chrome DevTools not find elements not
search)
I'm writing some Selenium code and need to get the CSS Selector for an item on a page. So I bring up the page and go into Tools mode. It doesn't matter which browser I use - Chrome, FireFox, Edge - when click on the "Pick an element from the page" button (to the left of the Inspector in FireFox) and then click on the item I need the CSS Selector for I see the element in the tools section, but as I'm right-clicking it and choosing Copy->CSS Selector, the table it's in collapses (in a second or two) and I no longer have access to the item I clicked on. I've tried manually expanding the TR in the tools view and drilling down to the TD I need, but the same thing happens.
Anyone know of a way to stop this from happening? I was quick enough to copy a few yesterday but for some reason it seems to be happening faster today and I'm not able to catch it.
Right-clicking the item and choosing Inspect Element was also suggested but that does the same thing. The item shows up in the tools section for about 2 seconds and then the table collapses.
When the element tree collapses, it is a sign that it got updated. This happens, for example, when an iframe's URL or document is changed or the child tree structure gets replaced via JavaScript.
In order to stop this from happening, you can stop the JavaScript execution on the next execution once you see the element you want to inspect. Then you are able to inspect the element using the inspect button.
Firefox
Switch to the Debugger panel.
Once you see the element you want to inspect, click the Pause button or press F8.
Cause the JavaScript execution to stop (e.g. by interacting with the page). You can see that the JavaScript execution is stopped when there is a white overlay on the page and a hint saying Paused at Execution.
Once the execution is stopped, click the Pick an element from the page button in the toolbar or press Ctrl+Shift+C.
Click the element you want to inspect.
Chrome/Edge
Switch to the Sources panel.
Once you see the element you want to inspect, click the Pause script execution button or press F8.
Cause the JavaScript execution to stop (e.g. by interacting with the page). You can see that the JavaScript execution is stopped when there is a hint on the page saying Paused in debugger.
Once the execution is stopped, click the Select an element in the page to inspect it button in the toolbar or press Ctrl+Shift+C.
Click the element you want to inspect.
I found a semi-workable solution. When the item appears in the tools window note it's name before it disappears. Then go to the Search HTML box and type it's name. It still appears and then disappears, but it seems to stay visible longer.

ShadowRoot handling in Safari

When I put a focusable element in the shadow DOM, OSX Safari doesn't include it in the tab sequence (unlike all other browsers). The button is visible, clickable but not accessible for keyboard users. Is this a known bug? Is there a way to handle it besides making the component tabbable and forwarding focus (which seems kind of gross)?
Here's what a minimal example looks like in Safari's console
<div class="host">
Shadow Content (Open)
<button>Click me</button>
</div>
I created this example by calling .attachShadow({"mode": "open"}) on div.host then setting its .shadowRoot.innerHTML to "<button>Click me</button>"
I'm having this issue in components I created. I tested the example above in Chrome and the button is included in the tab sequence as expected.
Safari doesn't enable tab navigation by default, it must be enabled via preferences.
Tab highlights the next text field or pop-up menu. Tab also highlights
buttons and other controls if “All controls” is selected in the
Shortcuts pane of the Keyboard pane of System Preferences.
Option-Tab highlights the same items as Tab plus all other clickable
items.
To swap the behavior of Tab and Option-Tab, turn on “Press Tab to
highlight each item on a webpage” in the Advanced pane of Safari
preferences.
https://support.apple.com/guide/safari/keyboard-and-other-shortcuts-cpsh003/mac

How I can inspect the elements that appear while mouse click, disappear while mouse leave

I want to inspect the YouTube settings menu element in chrome-developer with c# selenium.
The YouTube settings menu element appears on mouse click, but disappears if the mouse is moved out, so I cannot inspect the element in chrome-developer.
Any ideas?
ctrl+shift+i, then try the "Sources" tab, then go to the file you're trying to debug, then add line breakers. Next refresh the page. Here's an image of what we're looking for, inspected the google.com page for this one.
Once you have reached the line break for the mouseclick on the debugging, you can go to the elements tab, it should have the elements currently paused on the screen.
Visual studio and Chrome Browser as half of the Width of window
Breakpoint after click
At chrome browser, press F12 for inspect
We can find the settings dialog element in inspect tools area.
We must not click the html body area(Red Area) while debugging.

How to use Firebug CSS on dynamically appearing components?

I am working on a Javascript Based site, which uses the Dojo Framework.
I am using a DataPicker. I wish to change the background color of the datePicker, and hence I wish to look at where in the CSS is the color being set, so that I can override it in my CSS.
Usually I use FireBug and 'Inspect Element in FireBug' to view the HTML and CSS together. (or even Google Chrome's developer tools)
However this datepicker is a dynamically created component, and If I right click, or move my mouse into the Firebug window, the date picker is shutdown/destroyed. (You can check out the sample on the linked page itself)
Is there a way to inspect the CSS on these kinds of dynamic elements, using Firebug, or something else?
The best approach I've found for the dijit popup widgets is (using chrome)
Open the popup (in this case the date picker)
Right click on the element
Select "Inspect Element" from context menu
Chrome will open and transfer focus to the developer tools without blurring the focus of the page, keeping the popup open, allowing you to modify attributes and css rules and getting instant feedback.