Note that there are some explanatory texts on larger screens.

plurals
  1. POIssue while clicking on 'find hotels' using Selenium-Java
    text
    copied!<p>I am using Selenium (web driver) - Java. I picked a travel site to do demo of automation. On this travel site, at home webpage, I need to place following input before submit the form.</p> <ol> <li>Provide City name</li> <li>Date from and Date To</li> <li>Click on Find hotel button.</li> </ol> <p>I am able to do following:</p> <ol> <li>Done</li> <li>Done</li> <li><strong>Unable to click on Find hotel button.</strong></li> </ol> <p>On 3rd step, whenever I am clicking on 'Find button' through selenium code, it redirect page to some other website (not sure from where its redirection is coming).</p> <p>My question is: is I am doing something wrong? Below are the details:</p> <p>Web page source code:</p> <pre><code>&lt;div class="clear"&gt;&lt;/div&gt; &lt;div class='multiSearchBox' &gt; &lt;div class='clear'&gt;&lt;/div&gt; &lt;/div&gt; &lt;div class="block_bottom"&gt; &lt;div class="bottom"&gt; &lt;button class="search" type="submit"&gt;Find Hotels&lt;/button&gt; &lt;input type="hidden" name="passengers" autocomplete="off" value=""&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="clear"&gt;&lt;/div&gt; &lt;/form&gt;' </code></pre> <hr> <p>here is the button code which shows up in inspect element:</p> <pre class="lang-html prettyprint-override"><code>&lt;button class="search" type="submit"&gt;Find Hotels&lt;/button&gt; </code></pre> <hr> <p>Here is my code:</p> <pre class="lang-java prettyprint-override"><code>public void SubmitForm() { WebElement Submit = Driver.findElement(By.className("search")); System.out.println(Submit.getText()); Submit.submit(); } </code></pre> <p>I tried with following as well:</p> <pre class="lang-java prettyprint-override"><code>Submit.click(); </code></pre> <p>But no luck.</p> <p>However, I am getting button label: 'Find Hotels' in output but page gets re-directed to some other search page.</p> <p>Doing manual click 'Find hotels' button on web page works fine.</p> <p>I tried with Chrome and Firefox, I am facing same problem.</p> <p>Please see if some can help.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload