Webdriver does not provide direct any function to image verification, but we can verify images by taking two screenshots of the whole web page using TakeScreenshot WebDriver function, one at script creation time and another at execution time.  I have created a sample script in which first I captured a Google home page screen shot and saved (input.jpg) into my project, another screen shot (output.jpg) captured on the same page at test execution time and saved into the project. I want to compare both the images if they are not same then test script will fail.  How should I apply logic in image verification using selenium?
In my team, we use Selenium for automation of functional testing. We also do a lot of manual regression testing to make sure the appearance of the rendered web pages is ok. I would like to develop a framework, that would allow comparing screenshots of the "base" live web page, and the web page on the test server after applying the software update. I believe this will drastically reduce the amount of manual regression testing we need to do.   I would like the framework to be able to detect portions of web pages that were rendered differently from each other. An example of such functionality can be  (first image in the article)  I have never worked with image processing and would need ideas on what algorithms are already publicly available that would help me with the task. From what I can see, the simple pixel-by-pixel comparison would not work well, because it does not account for the concept of elements.  Or am I approaching this problem from a completely wrong direction?
Dropout: scaling the activation versus inverting the dropout When applying dropout in artificial neural networks, one needs to compensate for the fact that at training time a portion of the neurons were deactivated. To do so, there exist two common strategies:   scaling the activation at test time inverting the dropout during the training phase   The two strategies are summarized in the  below, taken from .  Which strategy is preferable, and why?    Scaling the activation at test time:    Inverting the dropout during the training phase: NoSuchMethodError error for getActionBar() (API-8) Pushforward of inverse map at the identity? Let $G$ be a Lie group and $i:G \rightarrow G$ denote the inversion map $i(x) = x^{-1}$. (Notation: $f_*$ is the pushforward map $F_*:T_pG \rightarrow T_{i(p)}G$ which takes $(F_{*}X)(f)=X(f\circ F)$ and $X$ is a tangent vector, $X\in T_pG$.) I wish to show that $i_{*}:T_{e}G\rightarrow T_{e}G$  is given by $i_{*}(X)=-X$ As a first step, it is trivial to prove that $i_*$ is an involution as $\mbox{Id}_{*}=(i\circ i)_{*}=i_{*}\circ i_{*}$ but I can't seem to make any further progress. Any help would be appreciated. Photons in expanding space: how is energy conserved? If a photon (wave package) redshifts (stretches) travelling in our expanding universe, is its energy reduced?  If so, where does that energy go? Grub: reboot to specific kernel I'd like to ask for help getting grub-reboot to work.  The theory: According to  (and other sources) I should be able to choose the kernel for the next reboot, using grub-reboot. However, this does not work for me; grub always boots to the default kernel.  Here's what I tried:  $ grep GRUB_DEFAULT /etc/default/grub GRUB_DEFAULT=saved $ grep "menuentry " /boot/grub/grub.cfg  menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-f3a807d1-3fd6-4970-b741-5382e9801060' {     menuentry 'Ubuntu, with Linux 4.4.0-43-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-43-generic-advanced-f3a807d1-3fd6-4970-b741-5382e9801060' {     menuentry 'Ubuntu, with Linux 4.4.0-43-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-43-generic-recovery-f3a807d1-3fd6-4970-b741-5382e9801060' {     menuentry 'Ubuntu, with Linux 4.4.0-36-generic' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-36-generic-advanced-f3a807d1-3fd6-4970-b741-5382e9801060' {     menuentry 'Ubuntu, with Linux 4.4.0-36-generic (recovery mode)' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-4.4.0-36-generic-recovery-f3a807d1-3fd6-4970-b741-5382e9801060' {  # Version 1, using the name $ sudo grub-reboot "Ubuntu, with Linux 4.4.0-36-generic"  # Version 2, using the id $ sudo grub-reboot gnulinux-4.4.0-36-generic-advanced-f3a807d1-3fd6-4970-b741-5382e9801060  # Version 3, counting $ sudo grub-reboot 3   Neither of these commands seem to have an effect; after reboot, I always end up with the 4.4.0-43 kernel.  Note: This is on Ubuntu 16.04 Xenial. It is a server machine and I don't have access to the console during boot, so I can't look at the grub menu :( What is the www-data user? Rules when using a Joker I had on my rack among other tiles, a black 9, 1 x blue 10, and a black 12.  On the table was a set of 3 x 10s including a Joker(no blue 10), and other sets of tiles including an available black 11.  Can I replace the joker with my blue 10 and then set out :  my black 9, the joker(representing a black 10), a black 11 from the table, and my black 12? Are both expressions correct? If yes, do they have different meanings? It seems to me that I came across both of them in books, but I'm not sure. What is the proper way to explain the twin paradox? The paradox in the  is that the situation appears symmetrical so each twin should think the other has aged less, which is of course impossible.  There are a thousand explanations out there for why this doesn't happen, but they all end up saying something vague like it's because one twin is accelerating or you need general relativity to understand it.  Please will someone give a simple and definitive explanation for why both twins agree on which twin is younger when they meet for the second time? How to install Ubuntu on portable external Hard Drive? I mistakenly deleted around 2,000,000 records from a remote SQL Server 2008 table.  The server is not granting me access to the backup files on the server side.   Is there any way to get back these records? Isn't every subset of a compact space compact? Let $\mathfrak{C}$ be an open cover of a topological compact space $X$, and let $\mathfrak{B}\subseteq \mathfrak{C}$ be its finite subcover. Then every subset of $X$ also has the same cover and subcover! Shouldn't every such subset also be compact then?  Motivation: I read somewhere that every closed subset of a compact space is compact. I wonder why it shouldn't be the case for every subset of $X$, rather than just the closed ones. How to create a virtual audio device and stream audio input with it Here's my concrete problem:  I am broadcasting a game via XFire and it uses the Windows audio device to capture any audio I receive. As I am broadcasting, other users who watch the video stream are communicating with me over Skype, and they hear themselves back within the video stream and it is entirely logical since I am broadcasting the audio I hear.  What I want to do is create another audio device within Windows and redirect (pipe) ONLY the audio input from that game and not the input reveived from Skype. I would then tell XFire to use that newly created "virtual" audio device to broadcast and therefore my partners won't hear themselves back.  Is it possible to create another audio device and redirect only wanted input streams to it? DMed for the first time yesterday and one of the things I feel I need to sort out, among other comments, improvements, and similar, is how combat itself is actually initiated. The main example I want to use involves  attempting to generate surprise conditions by players. Here the characters have entered a ruined city and generally been noisy about the whole thing - using a spell to make their voice louder and literally ask if there is anyone about. Any enemies around probably know what something is about to kick off but arguably don't know precisely what. After resting the PCs head up a long flight of steps to a temple on the edge of the city. At the top only one crests and finds 3 bandits lounging around, chatting, and doing whatever bandits do in their spare time. After a brief exchange of pleasantries a combat starts:  DM &quot;The bandit spits in your direction 'we're not done looting the temple, so you can clear off', and starts raising his crossbow as his mates emerge from their cover behind the pillars... PC &quot;I cast Firebolt at Bandit Keith&quot; DM &quot;Hang on, I hadn't finished, everyone rolls for initiative...  Which sparked a debate about whether or not the PC could preemptively cast/attack before the combat starts by &quot;instant actioning&quot; (as above) as I was describing the start of the combat. As far as the bandits are concerned a lone half-elf who is pretty heavily armed has popped up in front of them, not even tried to be diplomatic, and ended up saying something rather suggestive about their mothers. The PC then asked about it being &quot;surprise&quot; because the bandits wouldn't necessarily expect an attack, but my view of &quot;surprise&quot; is closer to an ambush where one party is unaware of the other's existence. (This precise example is close to how  works, however this specific PC was always the first of the party to go into rooms (only one with darkvision) and consistently felt they should get free rounds at the start of combat based on declaring attacks before I could &quot;start&quot; the combat.) The second example the party came to more bandits, who were not alert immediately, in an underground room. They used magic to yell something obscene at the bandits and shut off all the torches so the bandits were effectively blinded. At this point they wanted to burst into the room casting spells, swinging maces, and playing some &quot;meaty chords&quot; (the bard's words, not mine). Again they wanted surprise arguing that, despite the fact that the bandits were yelling and cursing in confusion, they couldn't be sure they were actually being attacked as such. In the end a character with darkvision wanted to sneak in to a corner and again wanted surprise based on passing stealth rolls, so they would start the &quot;combat&quot; by firing a crossbow. At that point I think I relented because it was clear that they would do anything to try and win combats in a single round. In a nutshell, my question is: &quot;how liberally can the concept of surprise be applied to combat - is it only when one party is literally unaware of a threat (as I read the rules), or just when they are caught slightly off guard by the exact situation?&quot; NB I already plan to address the attempts at interrupting descriptions with actions next session, because it happened at other times and actually threw me off quite a bit. Could humans choose to establish fibre digesting colonies in our guts? Humans don't digest fibre, and nor do any animals, but some creatures have micro-organisms (bacteria, I'm guessing) in their gut which digest fibre for them.  My question is, could humans take some sort of pill and establish our own fibre-digesting colonies in our intestines?  Has this been tried?  Supposing it could be done, would you suppose it would have any negative effects on our health?  (i.e.. would those whose gut digested fibre for them be stuck on a low-fibre diet?).    Purpose of question: just wondering.  It would be cool to be able to eat bark. How to disable javascript modal popup ads Does a Readied spell immediately use a spell slot? Explicit example of a compact manifold of dimension $>2$ with strictly negative sectional curvature I am looking for examples of compact manifold of dimension $&gt;2$ with strictly negative sectional curvature (for dimension 2 it is well-known). Can anybody please help? Badges with long names overflow on the profile page What's the single-word for "left or right handed"? 'Male'/'female' is to 'gender' as 'left-handed'/'right-handed 'is to...?  Is there a word to describe this? For example, if I ask a guy     What's your ____?   It should mean I'm asking whether he's left or right-handed.  Another example could be     Our designs are not biased  against your ____.   Basically, I'm looking for something that means the state of being left- or right-handed which could be used analogously as gender.  EDIT: Sorry for the delay in the edit, but I was tied up. There are some points I'd like to clarify:   I'm not looking for a way to paraphrase my questions. I'm looking for a single word. I know people normally ask something along the lines of "Are you left-handed or not?" People also ask "Are you afraid of the dark?" instead of "Are you scotophobiac?". The word for it,  still exists, right? It has been pointed out that I should go with Our designs are not biased against left-handed people as that is what I mean. But that is not necessarily what I mean.    For example, let's say there is a washbasin with the tap on the right. Clearly, it's biased against lefties. Sometimes, you come across a washbasin with a tap on the left. (The logic being: you use your left hand to turn the tap as your right one's dirty). But, your right hand might not always be dirty, in which case, it's biased against righties.  A washbasin with the tap on the center is, then, handedness-blind or chirality-blind, if you will. (I foresee that some would dwell on Our designs are symmetrical. Please don't.)  I'm looking for a term that would be applicable here, as well as in the 1st example.  My favorite so far is chirality, suggested by Dan Bron in a comment (with 25 upvotes!) But, I'm reluctant to use it because there's no hard proof it's used in that sense  If we are talking about male-female, gender works perfectly. What's your gender? and Our designs aren't biased against your gender. , both work perfectly here.  Sorry for the late edit again. If the consensus is that I rollback, I will. Let me know in the comments.