I´m trying to upgrade the Mozilla pdf.js library from 2.6.347 but get the error
pdf_viewer.js:254 Uncaught Error: The container must be absolutely positioned.
But when upgrading to a later version and setting the container to be absolutely positioned I obviously get a different behavior. I´m trying to use the browser scroll not the scroll of the container. How can I do this?
Expected behavior with 2.6.347:
https://stackblitz.com/edit/bootstrap-5-3v7wgs?file=src/index.html
What went wrong:
https://stackblitz.com/edit/bootstrap-5-brshqu?file=src/index.html
Related
I have two XPath's of the same element, a complete one:
//body/div[#class='body-widget']/div[#class='pseudo-popup-border']/div[#class='campaign competition language-en ng-scope']/div[#class='popup-blocks-container']/div[#class='popup-block']/div[#class='ng-scope']/div[#class='ng-scope']/div/div/div[#class='ng-scope']/form[#name='contestantForm']/fieldset[#class='center']/div[#class='center login-choice login-types-4']/ul/li[1]/a[1]
and a partial one
"//div[#class='center login-choice login-types-4']/ul/li[1]/a[1]"
which is the last part of the complete one.
When I use the complete path, I can retrieve the element and click it. However, when I use the partial path, selenium throws an exception Message: Element <a class="no-underline facebook-bg popup-window" href="javascript:void(0)"> could not be scrolled into view.
Even when I try to use something like a wait for the element to be clickable, I get the same problem. What is causing this?
When you are using the absolute path, selenium knows the exact html structure through which it needs to find the element but when you are using the relative path, selenium is searching for the center login-choice login-types-4 in the whole html structure and usually that also works but in your case, you are getting the exception Element could not be scrolled into view because the whole div of the element is not in the view or it is scrolled partially and hence the selenium is not able to click on it.
To solve your issue, you can first scroll to the element using JavaScriptExecutor scroll method and then you can click on that element and it would work fine
OR
You can directly click on the element using JavaScriptExecutor click method (but it is not recommend)
I'm running into the following error with Watir using Chrome Driver;
WARN: Selenium::WebDriver::Error::UnknownError: unknown error: Element is not clickable at point (762, 711)
I know the element is on the page, but it seems the element is just below the bottom of ChromeDriver viewport and needs to be scrolled to to be visible, in the size viewport that I see on my screen at least.
This is a related SO question, though I can't find a Ruby soution, can anyone advise. Thanks
Make sure you're using the latest chromedriver (2.33). There was a change in how scrolling worked with Chrome 61 and I think the fix was first available in chromedriver 2.32.
One way is to use scrollIntoView (assuming the element is the button):
browser.execute_script('arguments[0].scrollIntoView();', browser.button(id: testBTN))
Another way is an answer by Justin Ko:
Element is not clickable error Ruby / Watir
I have a basic slide-in slide-out animation for each route on enter and leave within my AngularJS app.
The animations work perfectly on desktop, although bug out on mobile. They do seem to work within the dev tools emulator though.
I have tracked it down to having something to do with the views position not being set correctly with the absolute position. Seems as if when a new view is loaded, they both exist within the page, hence making the pages width twice and large until the old view is unloaded and removed. I then tried a position relative on the parent container, although no luck.
WORKING DEMO
Use overflow: hidden for the container of your views, in the case of your plnkr, it's the <body>
I encountered today a weird situation. I have issues in a Joomla website (http://boaz.simplem-test.tk) I have built, with the way that Firefox determines the width of li (list item) between different computers.
The problem there is with the top menu. the entire ul.main.menu width in one computer is calculated as 705px and in another computer as 722px. when I looked at the items width, in each one there is 1-2 pixels difference.
Both computers have the same version of Firefox (20.0.1), both run on the same OS (Windows 7).
Any ideas as to why this can happen?
Opening up the CSS source code, http://boaz.simplem-test.tk/templates/main_template/css/template.css , reveals no explicit settings for width in the 'main menu'. As well, when I look at the page using Google Chrome's right-click 'Inspect Element' function ( in your case, due to a 'no-right-click' script, I had to access it using the Chrome Menu->Tools->Developer Tools ), the lis in the main menu report as width:auto. Since this is the case, each menu item is automatically assigned a width according to the text contained in it, and the menu as a whole could be affected by this. In the said console width of the whole menu is calculated as 705px, but I could not find where this was specified in the code. But the crux of the problem seems to be the header <div>, which comes in at 975px, instead of 1000px, like the rest of the page. You ought to specify width="1000px" for the header, and that might fix the problem. בהצלחה!
I've had an intermittent problem that I thought was due to un-cleared floats. What happens in Chrome (my main development browser) is the vertical scrollbar will lock in the top position and I cannot scroll down the page. Initially when the page starts to load it will allow you to scroll and then when the page is loaded it will jump back to the beginning and lock itself.
I've just been ripping apart my pages looking for un-cleared floats and missing tags and finally found out that it is due to a URL having a # at the end (which gets programatically added and remains when I refresh the page).
This issue only happens in chrome - does not appear to happen in other webkit browsers.
I assume its looking for an anchor and not finding it and then giving up. Its definitely a bug but was wondering about a workaround, or why it is only doing it on my site - I can't duplicate it for instance here.
Shift click the URL to open in new browser:
URL that will lock : /faq#
URL that doesn't lock (same but without the #): /faq
For me, the solution was in a popup div's style: I had to make sure a div with a z-index and no float but surrounded by floating divs was given the style float:none and an explicit width (floating this was not needed as it was absolutely positioned). I have a thread working through this here.