RE: i have error for checking the sublinks using data driven from excel and it takes only two rows to read and then having error like can not find link text
Your code looks fine to me and may not be able to give solution without getting URL, Datasheet and Exception.
But the better way of doing this is to use Apache HTTP Client. With this you do not need to open the browser and navigate back to the home page. It just send the request using the apache API and get the response back from the web server. It is hell fast and reliable.
Once you done with the download of it’ss JAR files and adding them to your project, use the below code:
int SResponseCode = Request.Get(URL).execute().returnResponse().getStatusLine().getStatusCode();
For the different response code, visit HTTP RESPONSE CODE