How to tell bottom of page has been reached? - selenium

I'm trying to use Watir (via Ruby) to jump down the page using the space key, on a page that has infinite scroll. How can I tell if the bottom of the page has been reached?
I found an SO answer with some JavaScript that says when. Could I use that to pop up a dialog (via execute_script) if the bottom has been reached and check for the dialog?
Is there a more straightforward way to do this?

You could just try this:
#browser.scroll.to :bottom
And if that doesn't work:
#browser.driver.executeScript("if((window.innerHeight+window.scrollY)>=document.body.offsetHeight){return true;}")
could surely be used to scroll until it returns true.

Related

How to conditionally render an input accessory view?

I am trying to conditionally render an input bar that appears above the keyboard when the user is tying. I do not want to show this input bar unless the user wants to add something. So they tap a button which is supposed to make the component visible and then focus on the input which brings up the keyboard.
This works as expected except when the user first opens the keyboard. Nothing appears. There is an empty view tag as the keyboard comes up but then it disappears and there is nothing. However, once the user starts typing it appears and after that works as expected. I have no idea why it isn’t appearing. If I don’t type anything and dismiss the keyboard you can see it briefly before it goes away as it is supposed to.
I have tried calling the function with async-await and my current syntax. Neither is working and I have been unable to solve this.
Here is a snack that recreates the issue and contains all the relevant code to reproduce the error.
https://snack.expo.io/#dmargulies/inputaccessoryview-problem
Thank you for your help.
First of all InputAccessoryView exists only on IOS.
I changed conditional rendering flow.
Look at: https://snack.expo.io/#djalik/inputaccessoryview-problem
For anyone looking for a cross-platform solution, there is a package:
react-native-keyboard-accessory
Note: I'm not the author, just figured it might help some peeps.

How to verify text using selenium on popup notification before vanishing it

There is a requirement like verifying Text using selenium on Popup notification before vanishing.
Not find any suitable solution for this.Please help me in this use-case
You can use the below code to get text from popup after that you can assert with the expected text
String value =driver.switchTo().alert().getText();
it is really unpredictable to understand your scenario.We must need pop-up HTML and a screenshot, and what problem you are facing.Sometime the pop up might be bootstrap modal or alert, so without knowing the popup, it is not possible to give the solution.Besides you can try simply find the element and use getText() function.If it is simple modal(Bootstrap), it will give you the text.
If you are struggling to find the element you can pause the JavaScript by using F8.

How to wrap text in quick documentation in IntelliJ?

After Ctrl+Q (Quick documentation) I could not see all text. I have to scroll horizontally to see all content. I could not make the editor to fit the window.
UPDATE:
The problem is only symbol definition, ie. the first line. The description (block text) is wrapped correctly. Actually, I don't want to resize this window as I prefer to keep it as I write in the same position for quick reference. I have to add that my monitor is quite small (15-inch) which is probably causing the problem.
Indeed method signature in the popup is not wrapped. There is a request you can vote for: IDEA-169414.
UPDATE: The documentation popup is reworked in 2018.1 and it should be fixed.
I'm not aware of a way to configure IntelliJ to wrap text in these windows.
I think the quickest way to see the full line in the quick documentation window is to press Ctrl+Q again to make it a little bigger (and center it) or maximize it with Ctrl+Shift+"
Keep in mind that the smallest version (the one that appears after the first Ctrl+Q) can be resized by hovering the mouse cursor over its edge and dragging it. It's going to retain the same size the next time you open it.

Prevent window from being captured

I'm solving this problem so long an i can't find solution.
I would like to capture a screen but i want to exclude a specific window.
Like capture whole screen but remove an window from it.
Or what i have to set to notepad like styles or something to being captured ?
Thanks
Regarding screen capture, you could hide window/capture/show window using windows api calls. Second question I did not understand.

How to fix a non responding ext.list?

I've got a problem with an Ext.List:
You press a button on the main menu and are shown the list. Everything on it works fine and it let's you choose, where to go deeper inside the app. No problems so far.
But if you then go back to the main menu by pressing a "back"-button and reenter the page, that shows this Ext.List, it doesn't work anymore: you can't select an entry of the list.
The "back"-button removes the list, if you return to the main menu this way:
setTimeout(function(){page.removeAll();},100);
What's my mistake? Do you know a better method than "page.removeAll()" that really kills this Ext.List to let it then be completely recreated when I choose to see it in my main menu?
Thanks in advance, you guys have the best tips and tricks.
It's hard to tell without seeing your code but I suspect that there is a javascript error somewhere in the program flow that you described. If you display the javascript console in either Chrome or Firefox it should show the error.
Depending upon how the function that creates the list is defined it would normally recreate the list upon page/function entry and there should be no need to 'kill' the list explicitly.