I'm using Firefox to get information of a HTML website in order to do some automation with Python and Selenium. So far, stuff was great and worked as expected.
Now I have the following situation:
An element appears only when moving the mouse over an item, activated by JavaScript.
Once I move the mouse away, the element disappears, again by JavaScript.
How do I stop JavaScript immediately after I have identified the element?
I have tried:
deactivating JavaScript completely. But then the element does not even appear.
deactivating JavaScript after I used the inspector . However, pressing F8 does not work, because I'm not on the debugger tab, but in the inspector tab. I can't move my mouse since the element disappears.
Use keyboard shortcuts to switch to the debugger tab. I.e.
Use to identify the element
Do not move the mouse once you hover over the element
Press Ctrl+Shift+Z to activate the debugger tab
Press F8 to pause execution
Use the mouse or press Ctrl+Shift+C to go back to the inspector tab and analyze the element
Related
If you go mouse over on above area then 3m,6m,1y and all are visible. If you go mouse down then it disable. How to handle this type of case in selenium.
As per my understanding you will have to use Action classes's mouse hover to get the pop up for months.
....Use developer tool to highlight the chart on which you need to hover the mouse, now hover the mouse to get those month's pop ups. and see in developer tools for changes in dom so that you can get their xpaths. Make sure you use "driver.click" to click on months. you can try xpath= //*[.='3m']. Just try to find out exact value of * using developer tool.
Thanks for quick response.
I have tried with your solution but the xpath is not working and give the nosuchelementexception. Because in the HTML Dom there are 2 iframe. Inside child frame we goto mouse over then it's visible . We mouse down then it is disapper. So my question is how to pause the mouse over section at certain time period so that all text are like 3m,6m,YTD,1y,All are visible and click one by one
In the DOm first div tag then the sequence order like
,, then 3m is displayed .
Could you please provide me the alternative solution?
I've got a simple A tag:
Link Text
Every now and again IE gets confused the the link stops working. When the mouse hovering over the link, its a normal cursor, on mouse-down it changes to 'not-allowed' and on mouse-up nothing happens.
I can refresh the page and it works normal again for awhile, then it just stops working again.
How can I determine what is happening and fix it? There is no console output, there is script or events on the A tag or any of its parents. IE just borks.
This is an Angular application if it matters at all.
For clarification, I don't want any pointer changes at all, I don't want the link to randomly stop working. I just want the A tag to behave as normal. It does so in all browsers except IE.
I have encountered a quirky problem in IE when using AngularJS (1.2.13).
The solution is in general a report-generator, which uses the routes to determine which report to show and the route parameters as the parameters for the given report.
One way to produce the exception is:
I click on a link in the menu.
Then I copy the url (from the address bar in IE).
I click on another link in the menu.
Then I paste the copied url into the address bar in IE and press enter.
This works fine, the view changes to the correct view.
Then I click on another link in the menu.
And then I paste the copied url into the address bar in IE again and
press enter.
After the final step, nothing happens, the view stays the same as it was.
If I press F5 however, it changes.
If I click on another link from the menu the solution will change to that view. Pasting the url again into the address bar, will lead to the same behaviour, nothing happens. All subsequent pastes fails, only the first one works.
This happens only in Internet Explorer (IE10), not in Chrome or FireFox.
The urls are #-based.
Tried to attach an $locationChangeSuccess and $routeChangeStart event to check what happens, but neither event is called when I paste in the url the second time.
Is there anybody who has encountered this problem before or know what is causing the behavior?
My cursor is right where it needs to be in my text editor - visually. When I continue typing from the keyboard - nothing is shown. The cursor is in the browser (when I press up-down arrow keys from the keyboard - the browser page is moved up/down). I need to click on the text editor so that I can continue typing. Even though the cursor is visible and blinking in the text editor. I use tinymce and ie9. (I use ie9 just for testing purposes, I'm not crazy).
When I execute:
document.activeElement
it returns that an iframe element has focus, and not the text area.
I'm trying to show a context menu when I left-click a NotifyIcon. Just calling NotifyIcon.ContextMenuStrip.Show() doesn't work very well. A solution has been posted here before that calls a secret method using Reflection:
Dim mi As System.Reflection.MethodInfo = GetType(NotifyIcon).GetMethod("ShowContextMenu", Reflection.BindingFlags.Instance Or Reflection.BindingFlags.NonPublic)
mi.Invoke(Icon, Nothing)
This works great, except that I also need to control where the menu is shown. I want to wait for the SystemInformation.DoubleClickTime to elapse between receiving the NotifyIcon.MouseUp event and displaying the menu, so that I can handle single-clicks and double-clicks separately. But invoking the ShowContextMenu method displays the menu at the current mouse position when ShowContextMenu is called, not when the icon was actually clicked. Which means that if the mouse moved during the DoubleClickTime, the menu will be displayed in a different part of the screen. So if I can control where the menu is shown, I can just save the mouse coordinates when I receive the MouseUp event, and then I can ensure that the menu is displayed near the icon. Is there a way to do this?
Thanks in advance.
Well, I just discovered that there are existing programs that exhibit this same behavior. I just went through all the icons in my system tray and about half of them do it. If you left-click the icon and then move the mouse during the delay before the menu appears, the menu will appear at the last mouse location, wherever that is on the screen. Snagit is one application that does this. Outlook is the only program in my tray that always shows the menu where I clicked the icon. But Snagit looks like it's using a .NET ContextMenuStrip, while Outlook is probably using a native menu.
So either this is standard behavior, or it's a problem that no one else has been able to solve either. And as a user, I've never noticed this behavior until yesterday when I was testing my own application. So I guess it's not that big of a deal and I won't worry about it.