Unable to find a button and click

Answered
Unable to find a button and click
jbfannie Train Asked on December 5, 2014 in Selenium WebDriver.

Hello

What type of question is this ?

Can you please post some code also what you have used or xpath /Css for identifying the element ?
I am sure pasting just picture of Dom wont be much helpful to you and others

on December 7, 2014.
Add Comment
2 Answer(s)
Best answer

Hi Ayo,

I suggest you to use the Firepath tool to get the xpath of this button and I think we resolved this issue last sunday. If yes, please close this question now.

Regards,
Lakshay Sharma

xLov3rDns Professor Answered on December 8, 2014.
Add Comment

I tried using xpath and other locators but no luck. The button actually perform submit action but does not process the transaction. The temporary page comes up. below is the code used.. the xpath and css acre commented out to try other locator. It has to do with the button.

//driver.findElement (By.xpath(“.//*[@id=’placeOrderForm’]/section/fieldset[1]/div/div[2]/div/input”)).submit();
//driver.findElement (By.css(“css=input.button.highlight</td>”)).submit();

WebElement formWrapperDiv = driver.findElement (By.className(“form-wrapper”));
WebElement placeOrderForm = null;
List<WebElement> listOfForms = formWrapperDiv.findElements(By.tagName(“form”));

for(WebElement wb : listOfForms)
{
if(wb.getAttribute(“id”).equals(“placeOrderForm”))
{
placeOrderForm = wb;
}
}

if(placeOrderForm == null)
{
System.out.println(“Couldn’t find form with id – placeOrderForm. Please investigate.”);
}
else
{
placeOrderForm.submit();

jbfannie Train Answered on December 13, 2014.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.