This question already has an answer here:
I am using TestNG
framework. I get data from xlsx doc
using data providers. When I run my code I am getting as -
org.openqa.selenium.NoSuchElementException: Cannot locate element with text: row 2 or column
Currency does not exist in xls(Currency is the field name), The same error is getting typed inside the text field also.
My code ''' public void newAgent(String CompanyName, String Currency,String MarkUpType, String MarkUpValue, String CompanyStatus, String CompanyLogo) {
driver.findElement(By.name("name")).sendKeys(CompanyName);
Select currency = new Select(driver.findElement(By.name("currency")));
currency.selectByVisibleText(Currency);
Select markUpType = new Select(driver.findElement(By.name("markup_type")));
markUpType.selectByVisibleText(MarkUpType);
driver.findElement(By.name("markup_value")).sendKeys(MarkUpValue);
Select companyStatus = new Select(driver.findElement(By.name("status")));
companyStatus.selectByVisibleText(CompanyStatus);
driver.findElement(By.xpath("//input[@name='logo_url']")).sendKeys(CompanyLogo);
driver.findElement(By.xpath("//*[text()='CONTACT INFORMATION']")).click();
'''