title: selenium to click on several links one after other
body: <p>I have a table over a webpage having many values repeating like this:</p>
  
  <pre><code>Description     App Name    Information
  Some Desc1       App1         Some Info
  Some Desc2       App2         Some Info
  Some Desc3       App2         Some Info
  Some Desc4       App3         Some Info
  Some Desc5       App4         Some Info
  </code></pre>
  
  <p>At the start of my app, it will ask the user to enter an appname of their choice. What I want is if I choose APP2 it should select "Some Desc2" first, that will lead to another page and there I will do something. Then again it should come back to previous page and this time it should select "Some Desc3", that will lead to another page. This should be repeated n number of times until selenium can't find an appname specified.</p>
  
  <p>I have tried as shown below:</p>
  
  <pre><code>//Finding Table, its rows and coloumns
  int rowcount = driver.FindElements(By.Id("someid")).Count;
  for (int i = 0; i &lt; rowcount; i++)
  {
  //Finding App name based on user entered text
    var elems = driver.FindElements(By.PartialLinkText(text));
    IList&lt;IWebElement&gt; list = elems;
    for (int j = 0; j &lt; list.Count; j++)
    {
      var table = driver.FindElement(By.Id("someid"));
      IList&lt;IWebElement&gt; rows = table.FindElements(By.TagName("tr"));
      IList&lt;IWebElement&gt; cells = rows[i].FindElements(By.TagName("td"));
      //Again finding element based on user entered text
      var elem = driver.FindElements(By.PartialLinkText(text));
      list = elem;
      if (list[1].Text.Equals(text))
      {
        list[0].Click();
        string duration;
        string price;
        var elements = driver.FindElements(By.Id("SPFieldNumber"));
        IList&lt;IWebElement&gt; lists = elements;
        duration = lists.First().Text.ToString();
        price = lists.ElementAt(1).Text.ToString();
        MessageBox.Show(duration);
        MessageBox.Show(price);
        driver.Navigate().Back();
      }
   }
  </code></pre>
  
  <p>}</p>
  
  <p>Running this code selects "Some Desc2" correctly and everything went fine. But after returning to the previous page c# throws an exception "element not found in the cache - perhaps the page has changed since it was looked up selenium".</p>