I'm trying to get selenium to select a simple button that says next. I've tried XPath, CSS, and linktext and it still will not select it for me saying it cannot locate the element. Here is the code.
Edit: The button is inside an i-frame.
<button class="btn-next" href="#" data-next="true">Next</button>
Not sure why it cannot locate the element, this is the xpath that came out from it but still It cannot locate it.
findElement(By.Xpath(".//*[@id='step1']/button"))
It seems I was missing some of the HTML. Here is the entire part.
div class="form-container">
<form data-capture="true" data-ajax="false" method="post">
<div id="view1" class="view active_view" data-view-order="10" style="display: none;">
<div id="step1">
<ul class="btns">
<div class="clear"/>
<h1>I'm a</h1>
<h2>
<button class="btn-next" href="#" data-next="true">Next</button>