I am having difficulty accessing an edit box element that is within a web table. This is my code:
package cartsAndCheckout;
import org.openqa.selenium.By;
import org.openqa.selenium.NoSuchElementException;
import utility.Base;
import utility.Cart_Functions;
public class ModifyCart {
public static void main(String[] args) throws InterruptedException {
//search for product, add to cart
Base.openURL();
Cart_Functions.productToCart();
//navigate to cart
Cart_Functions.NavigateToCart();
//Change quantity
try {
Thread.sleep(10000);
Base.driver.findElement(By.cssSelector("#cart-444-qty")).sendKeys("5");
}
catch (NoSuchElementException e)
{
System.out.println("There was an error: 'No such element'");
}
}
}
I have selected the locator for the edit box, but it is throwing a 'locator not found' error, presumably because it's within a web table. Can someone please help?