I can't seem to find the correct xpath or locate this element using Selenium. I keep getting this error:
FAILED: homeLoan("John Smith", "[email protected]", "Australia", "1563", "62365896410", "Home Loan", "Buying", "100000", "50000") org.openqa.selenium.NoSuchElementException: no such element: Unable to locate element: {"method":"name","selector":"FullName"}
Here is my Selenium code:
@Test(dataProvider="homeLoan")
public void homeLoan(String fullname, String email, String countryTypes, String postcode, String phone, String loanType, String loanPurposes, String securityValue, String homeLoanAmount) throws Exception {
// open | https://test-www.loans.com.au/
driver.get("https://test-www.loans.com.au/");
// click | link=contact |
driver.findElement(By.linkText("contact")).click();
// type | name=FullName
**driver.findElement(By.name("FullName")).clear();
driver.findElement(By.name("FullName")).sendKeys(fullname);**
// type | name=Email
driver.findElement(By.name("Email")).clear();
driver.findElement(By.name("Email")).sendKeys(email);
The html structure suggests that the element I'm looking for might be inside an iFrame:
<body style="overflow:hidden;" onload="iframe_resize();">
<div class="UWP">
<section of HTML>
**<input class="form-control inputbox bg-icon-name" placeholder="Full Name*" data-bind="attr: { name: FieldPrefix() + 'FullName' }, value: FullName, enable: ShowCustomerDetails" required="required" name="FullName" type="text"/>**
<section of HTML>
The highlighted HTML code above is where I need to identify the xpath.
If anyone can provide assistance, it would be greatly appreciated. Thank you in advance.