0
votes

This is the html code :

...
<div class="span_3_of_4"> 
  <p class="text_popup"> Dont Have an Account? | 
    <a class="fancybox" href="#load_box">Signup</a> 
  </p> 
</div> 
<div class="span_1_of_4" align="center"> 
  <input class="button" type="submit" value="Submit"/> 
</div> 
</div> 
</form> 
</div> 
<script src="js/jquery.form.js" type="text/javascript"/>

Its a submit button. I am trying to automate a registration for using selenium webdriver. There are no ids or names as such for this button. Hence i tried with xpath (taken from firebug) .//*[@id='load_form']/div/div[2]/input and classname - button.

Yet the following error was being thrown Element is not currently visible and so may not be interacted withCommand duration or timeout: 428 milliseconds. Please suggest as to how can i ever overcome this error and be able to click on the "submit" button.

Selenium Version - 2.44

2
Could you add the code you've written for this ?JRodDynamite
e=driver.findElement(By.xpath(".//*[@id='load_form']/div/div[2]/input")); This the code that i had written for identifying the elemnt i also used By.className("button")user1411

2 Answers

0
votes

I encounter this issue a lot, and one thing that normally solves the problem is switching frames. With python I think it's something like driver.switch_to_frame('frame') I may be wrong there with the syntax but definitely try that out

0
votes

Try this one:

driver.findElement(By.xpath("//div[@id='load_box']/form[@id='load_form']//input[@class='button' and @type='submit']"))

Problem was that there are several form elements with "load_form" on the site and the first one is hidden! that's why you need a more specific xpath like the one above.