It throws NullPointerException while running JUnit. Error is being shown at line " driver.get(baseUrl)". Somehow it is not able to read data of String baseUrl. String baseUrl is defined at @Before and I am trying to read data @Test.  Please Suggest.   Below is my code :  public class JunitTest1 {     WebDriver driver;     String baseUrl;      @BeforeClass     public static void setUpBeforeClass() throws Exception {         System.out.println("Execution starts here");     }      @Before     public void setUp() throws Exception {         System.setProperty("webdriver.chrome.driver", "E:\\chromedriver_win32\\chromedriver.exe");         WebDriver driver= new ChromeDriver();         driver.manage().timeouts().implicitlyWait(60,TimeUnit.SECONDS);         baseUrl="http://spezicoe.wipro.com:81/opencart1/";     }      @Test     public void test() {          driver.get(baseUrl);         WebElement registerBtn = driver.findElement(By.xpath("//*[@id=\"top-links\"]/ul/li[2]/a/span[1]"));         registerBtn.click();         WebElement loginlink = driver.findElement(By.xpath("//*[@id=\"top-links\"]/ul/li[2]/ul/li[2]/a"));         loginlink.click();          //Login steps         WebElement emailId=driver.findElement(By.xpath("//input[@id=\"input-email\"]"));         emailId.sendKeys("username");          WebElement password=driver.findElement(By.xpath("//input[@id=\"input-password\"]"));         password.sendKeys("Suren!123");          WebElement loginBtn=driver.findElement(By.xpath("//input[@class=\"btn btn-primary\"]"));         loginBtn.click();     }      @After     public void tearDown() throws Exception {         System.out.println("Execution completed");     }      @AfterClass     public static void tearDownAfterClass() throws Exception {              System.out.println("Execution completed");      }  }
What are Null Pointer Exceptions (java.lang.NullPointerException) and what causes them?  What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
I'm using Ubuntu Maverick and Virtual Box 3+. I have Windows 7 Ultimate. The problem is that it doesn't detect USB drives in Windows 7, but USB peripherals (mouse + keybord) are working.  I followed , but I can't find the user group vboxusers. How can I continue? I would also like to upgrade to the latest version without any risk (without losing my virtual hard disk drive). Laser positioning on barn door tracker Installing IE8 in wine - error rename/sha1sum mismatch winetest.cat Please note, this is an informative QA post rather than a question specific, due to this issue popping up many a time.  QUESTION / ISSUE  How to solve the issue of installing IE8 (Internet Explorer) in wine (any version - to my knowledge).  Related Wine Errors:  Terminal install method  Installing IE8:  winetricks -q ie8   should give you a similar error:  Executing w_do_call ie8 Executing load_ie8 Executing wine iexplore -unregserver Executing w_do_call msls31 msls31 already installed, skipping Using native,builtin override for following DLLs: iexplore.exe itircl itss jscript msctf mshtml shdoclc shdocvw shlwapi urlmon wininet xmllite Executing winetricks_early_wine regedit /S C:\windows\Temp\_ie8\override-dll.reg Using builtin override for following DLLs: updspapi Executing winetricks_early_wine regedit /S C:\windows\Temp\_ie8\override-dll.reg Downloading http://winezeug.googlecode.com/svn/trunk/winetricks_files/winetest.cat to /home/user/.cache/winetricks/ie8 --2016-09-08 23:03:12--  http://winezeug.googlecode.com/svn/trunk/winetricks_files/winetest.cat Resolving winezeug.googlecode.com (winezeug.googlecode.com)... 66.102.1.82, 2a00:1450:400c:c06::52 Connecting to winezeug.googlecode.com (winezeug.googlecode.com)|66.102.1.82|:80... connected. HTTP request sent, awaiting response... 404 Not Found 2016-09-08 23:03:13 ERROR 404: Not Found.  ------------------------------------------------------ Downloading http://winezeug.googlecode.com/svn/trunk/winetricks_files/winetest.cat failed ------------------------------------------------------   GUI Install via Winetricks GUI method  or using the GUI method, you should see a error dialog similar to this: What does negative R-squared mean? Let's say I have some data, and then I fit the data with a model (a non-linear regression). Then I calculate the R-squared ($R^2$).  When R-squared is negative, what does that mean? Does that mean my model is bad? I know the range of $R^2$ can be [-1,1]. When $R^2$ is 0, what does that mean as well? Can the category of chain complexes be realized as a functor category? As the title says, is there some sort of category $\mathsf{C}$ which can be thought of as the "walking chain complex", so that the category of chain complexes in some other category $\mathsf{A}$ can be realized as $\mathsf{A}^\mathsf{C}$ (or perhaps some subcategory thereof)? Repeat each line multiple times Would like to have each line in a file repeated a fixed number of times.  e.g. have each line repeated four times:  a b c   becomes:  a a a a b b b b c c c c   I've done some searching, and there are a lot of questions and answers along the lines of doing the reverse, e.g. merging duplicate lines into single lines, and maybe a few about doubling lines by printing them again.  It would be easy to do this in C, but I wish I knew more about the native commands so I wouldn't have to resort to these kinds of one-off throw-aways all the time. WebView loading Url How do I hide a parent div if the child div doesn't contain an  tag? Uninstall GRUB and use Windows bootloader I am new to dslr's and got a nikon 3000 with 18-55 lens as a gift.  I already see some limitations with the lens for walking about or on trails.  So my question is being new should I go with a 55-200 or 55-300 or is there another step before I go with a telephoto lens. Is it possible to prevent DHCP service on SBS 2003 from shutting down due to rogue DHCP server? Downgrading from SQL Server 2008 to 2005 What is the formula for Real vs Apparent Depth, when not looking perpendicular to the interface?   I know the formula $$\frac{\text{real depth}}{\text{apparent depth}}=n$$   but I'm not looking for this. $\sum \cos$ when angles are in arithmetic progression Possible Duplicate:          Prove $$\cos(\alpha) + \cos(\alpha + \beta) + \cos(\alpha + 2\beta) + \dots + \cos[\alpha + (n-1)\beta] = \frac{\cos(\alpha + \frac{n-1}{2}\beta) \cdot \sin\frac{n\beta}{2}}{\sin\frac{\beta}{2}} $$ Implicit conversion issue in a ternary condition I bought a Minecraft account for my little brother for Christmas, and I'd like to play with him on my server every now and then. If I log in while he's on, however, it kicks him off since we have the same username. Is there any way to change my username so that I can play with him, or anything I can do so that we can both play together using this account on my server?  I'm open to anything that could let us play, whether it be username changes, server property changes, etc. How is prototyping done in a professional EE environment? Do you do your prototypes on breadboards, on copper clad boards, Manhattan style, or do you just draw schematics, order PCBs made and assembled and work with them, hacking here and there if necessary? Proving the measure of an increasing sequence of measurable sets is the limit of the measures Show that if $A_1\subseteq A_2\subseteq A_3\subseteq\cdots$ is an increasing sequence of measurable sets (so $A_j\subseteq A_{j+1}$ for every positive integer $j$), then we have $$m\left(\bigcup_{j=1}^\infty A_j\right)=\lim_{j\to\infty}m(A_j)$$  Here is my proof: According to the $\sigma$-algebra property, $\bigcup_{j=1}^{\infty}A_j$ is a measurable set, so it makes sense to talk about $m(\bigcup_{j=1}^{\infty}A_j)$. Firstly, I prove that $\lim_{j\to\infty}m(A_j)\leq m(\bigcup_{j=1}^{\infty}A_j)$. This is because for any given positive integer $N$, $A_N\subseteq \bigcup_{j=1}^{\infty}A_i$, according to monotonicity, we have $m(A_N)\leq m(\bigcup_{j=1}^{\infty}A_i)$. Take the limit,we will have $\lim_{j\to\infty}m(A_j)\leq m(\bigcup_{j=1}^{\infty}A_j)$. Secondly, I prove that $m(\bigcup_{j=1}^{\infty}A_j)\leq \lim_{j\to\infty}m(A_j)$. For any given positive integer $N$, $\bigcup_{j=1}^N A_j = A_N$. According to monotonicity,we have $m\left(\bigcup_{j=1}^N A_j\right)=m(A_N)\leq \lim_{j\to\infty}m(A_j)$. Take the limit, we will have $m\left(\bigcup_{j=1}^\infty A_j\right) \leq \lim_{j\to\infty} m(A_j)$. Combine the above two arguments, we will see that $$m\left(\bigcup_{j=1}^\infty A_j\right)=\lim_{j\to\infty} m(A_j)$$$\Box$  The above is my proof, unlike many books, my proof does not use the property of countable additivity. So I doubt my proof is correct. Who can point out where are my mistakes? Yes, it's time for me to complain about plagiarism again.  We already have Suggested Edit audits, but I would like to see Tag Wiki and Tag Wiki Excerpt audits that specifically introduce copied content for that tag without including the appropriate source(s), and warn people who approve it that they just approved a tag with plagiarized text.  For example, an audit for the  tag could be:     Microsoft SQL Server is a relational database management system developed by Microsoft. As a database, it is a software product whose primary function is to store and retrieve data as requested by other software applications, be it those on the same computer or those running on another computer across a network (including the Internet). There are at least a dozen different editions of Microsoft SQL Server aimed at different audiences and for different workloads (ranging from small applications that store and retrieve data on the same computer, to millions of users and computers that access huge amounts of data from the Internet at the same time). Its primary query languages are T-SQL and ANSI SQL.   Anyone who spends 15 seconds Googling this will see where it came from -- the problem is, most people don't.  I know with Suggested Edit Audits, it's just random text to catch the most egregious reviewers; for this, you would have to most likely select a small sample of tags, and then create their copy-and-paste entries for audits.    The whole point of this would be to raise awareness for people who have figured out how to recognize and pass Suggested Edit audits, but still don't understand the finer nuances of reviewing. QGIS Atlas generation for multiple map extents?