title: Unable to simulate click action on preceding-following sibling xpath
body: <p>I am trying to automate a test on a mobile app, and I having trouble simulating a clicking action on an element. I use Appium Studio to record the action, then copy the codes to Eclipse for modification. In Appium Studio, the syntax for the element in question is given as: </p>
  
  <pre><code>driver_App.findElement(By.xpath("//*[@id='home_icon' and (./preceding-sibling::* | ./following-sibling::*)[@text='Razer Gold Mini App']]")).click();
  </code></pre>
  
  <p>However, when I copy this line over to my automation script in Eclipse, the clicking action is not simulated and the whole automation stops operating without any error message until it hit</p>
  
  <blockquote>
    <p>org.apache.http.NoHttpResponseException: localhost:4723 failed to respond </p>
  </blockquote>
  
  <p>Probably due to inactivity.</p>
  
  <p>Following is my automation script:</p>
  
  <pre><code>static void RazerPayPage() throws InterruptedException{
          Thread.sleep(3000);
          driver_App.findElement(By.xpath("//*[@text='Region']")).click();
          driver_App.findElement(By.xpath("//*[@text='Malaysia']")).click();
          driver_App.findElement(By.xpath("//*[@text='Mobile number']")).sendKeys("123456");
          driver_App.findElement(By.xpath("//*[@text='NEXT']")).click();
          Thread.sleep(5000);
          driver_App.findElement(By.xpath("//*[@text='Log in password']")).sendKeys("password");       
          driver_App.findElement(By.xpath("//*[@text='LOG IN']")).click();
          Thread.sleep(8000);
          new WebDriverWait(driver_App, 10).until(ExpectedConditions.presenceOfElementLocated(By.xpath("//*[@text='OK']")));
          driver_App.findElement(By.xpath("//*[@text='OK']")).click();
          driver_App.findElement(By.xpath("//*[@id='home_icon' and (./preceding-sibling::* | ./following-sibling::*)[@text='Razer Gold Mini App']]")).click();
  </code></pre>
  
  <p>Hope to have advice on what mistake I have commit. Feel free to let me know if further details are required.</p>