Selenium IE11 Mouseover (hover) issue - selenium

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.

Related

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.

How can I fix a button that is clicked but does not perform any actions?

So I'm currently working on a new project and I need to write some automated tests.
I came across a problem and I don't know how to fix it. If the button of my web page is clicked running selenium it doesn't perform any actions, but if I open the web page manualy and click on the button, everything works fine.
NOTE: I'm completely sure that the xpath is correct and the button is being clicked...
This is what happens running with selenium:
And this is what happens openning the web page manually and clicking on the button:

Selenium not found element while page is opening in small screen

For our web application I wrote one selenium script, which is working very fine in my office workstation (which has big screen).
When I execute the same script for the same application in my laptop(which has small screen) it is not able to find the element.
Actually when I open the application in my laptop some elements are visible only when I scroll down the page but those element are visible in big screen without scrolling. Application view is automatically adjust as per the screen.
So, for these application how I can write the selenium script so that it will work any kind of screen ?
What do you mean by "it is not able to find the element"? Which error did it show?
In my own experience with automation, in some specific scenarios, the behavior of the app change when the scrollbar appears (for example, when I try to click on an element, it scrolls down to that element, but "jumps up" to the element above it - this I can reproduce manually.)
Some test scenarios are quite sensitive with scrollbar, for example drag&drop.
You should analyse each failed test separately and find a solution for each case.
Selenium cannot find element that is not visible, you must always check if element is visible and if not scroll to this element.
see this question Scroll Element into View with Selenium

What to do when the selenium click function is flaky

Has anyone had trouble using the selenium click function? Sometimes it cannot click on an element even though its visible. Sometimes it can click on an element that is underneath another element (that the user cannot click on). What's a good alternative?

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).