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

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.

Related

How to save a PDF opened in IE new browser

I have a scenario to save a PDF which is opened in a window. By default selenium control moves to the Window, As it is a banking application I cannot repost the URL to save the pdf, I cannot press CTRL + S and right click doesn’t have any required data but using Robot I can click or move to an element, now the save button will enable only if you mouse over at the bottom of the page. I tried using ROBOT mouse over but the pop up did not popped up may be the reason it is not navigating via UI.
I have tried Sikuli also as the save pop up only pop up while mouse over that also failed.
We cannot use Actions as it wont support Webdriver driver, I have used Sikuli and ROBOT class mouse over.
The save Pop up opens only when it is mouse over at the bottom of the page, and it is not happening in ROBOT class as it navigates via DOM. please help

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.

Selenium IE11 Mouseover (hover) issue

My tests use Selenium and Applitools Eyes to take screenshots of the test environment and compare it against the approved baseline. This is to automate visual tests of the application.
When I use IE11 to mouseover, I have attempted using all the solutions listed here, and even though I can get it to mouseover and display the menu, I still have another problem.
When I use the methods listed, the menu will display, and a screenshot is taken of the menu as expected. However, the cursor then REMAINS on the existing menu or the last place the cursor was.
This means if "Menu" is a mouseover menu, I can take a screenshot of the menu, and then click the menu, which is supposed to default me to the "Home" page. However, when I go to the home page, the cursor remains over the "menu" object, which means the mouseover menu pops up and ruins the screenshot for the Home page.
Any suggestions?
As a side note, this code works flawlessly in Firefox and Chrome.

Safari Web Inspector Showing Up In New Window By Default

I've been using Chrome and am going back and forth between switching to Safari or staying with Chrome. My one small issue with Safari though is that the web inspector always shows up in a new window every time I toggle it. I press Command-Option-I and it opens in a new window and when I press Command-Option-I again it does not go away. I love the way the web inspector functions in Chrome and am wondering if there's a way to run the same way in Safari.
Any thoughts are greatly appreciated. Thanks!
I have had the issue for a long time. Here is the solution.
Right-click on a web page and select inspect element.
The console window appears in Fullscreen. Minimize the window like any Safari web page and it should a window like below.
Just above the 'Elements' tab, you should be able to see 2 icons. Clicking the icon on the left, opens the Console in right side of the browser and clicking the icon on the right, opens the Console in bottom of the browser
Hope this helps.
None of the methods upon are working for me (Safari 9.1), if you want to make the docking buttons of the inspector showing up:
open Terminal
type defaults read com.apple.Safari "__WebInspectorPageGroupLevel1__.WebKit2InspectorStartsAttached"
Once you checked if it returns 0,
do:
defaults write com.apple.Safari "__WebInspectorPageGroupLevel1__.WebKit2InspectorStartsAttached" 1
It's a bug in the Safari codebase.
Here is the bugreport and they're working on it (source)!
You could press the leftmost button at the Inspector's status bar and Inspector will dock.
UPDATE: Now, the button is on the right. When Inspector is in a separate window, the two small buttons in its upper right corner make it move to the 1) bottom of the Safari window 2) right side of the Safari window.
The only method that seemed to work for me was to resize the browser to a big enough size that it was big enough to contain the smallest size of an individual Inspect window. This for me, was widening the browser to at least around 65% percent width of the screen, and then you can "Inspect Element" and the default would be that the Inspect window would be at the bottom of the browser, and the browser with the Inspect window in it is resizable to any size now. Hope this helps some people.
Follow these steps to fix safari issue
Go to Develop --> User Agent --> Safari --> Select iphone --> then click on right side top symbol...
Select it and do inspect then you can see the button on left side top corner.
Now set to default setting by redoing the first point.
Please follow the step
Try clicking as shown:
I hope you get as shown:
I noticed when you have an open tab like the start page, the web inspector will pop up in a separate window. Also, there are no icons in the web inspector to attach it to the bottom or side. If you have a webpage open and do the same thing in the same window, that tab will have the web inspector attached to the bottom of the page (or whatever your attachment selection was prior).