I am writing a selenium webdriver script . Below is the src code.
driver.get(baseUrl);
driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
driver.findElement(By.id("txtUserDefault")).clear();
// page one code works fine in unix...login page
// below is the partialLinkText which is working fine in eclipse but giving error in jar execution in unix
driver.findElement(By.partialLinkText("101")).click();
First page is login page and second page has below source code
<html>
<head>
<title>Test app</title>
</head>
<body>
<center>
<h1> Country selection</h1>
<table border=1 width=450>
<tr bgcolor="#BBBBBB">
<td><b>PU</td><td><b>Department</td></tr>
<tr><td>HK1</td><td><a href="https://www.test1.com">101</a> (Country1)</td></tr>
<tr><td>SG1</td><td><a href="https://www.test2.com">102</a> (Country2)</td></tr>
</table>
</center>
</center>
</body>
</html>
When i run the code through eclipse IDE , it runs fine . But when I export the jar and run the same code through xvfb in unix , it is able to log in first page and go to 2nd page . On 2nd page it is throwing NoElementFoundException (trying to click hyperlink 101 and 102).
I tried same thing thorugh cssSelector, partiallinkText ,xpath . Works fine in eclipse but throws same error in unix .