'Selenium 4 Java Chrome driver Find element support request

I would like someone to complete my coding , i have to input a value in text box and click next

OS -> MAC IDE -> Eclipse language -> Java SDK - Slenium Java

Link of the text box https://account.microsoft.com/billing/redeem

Not working codes driver.get("https://account.microsoft.com/billing/redeem");

//driver.findElement(By.xpath("//input[@class='ember-text-field ember-view' and @id='tokenString'][@name='tokenString']")).sendKeys(fileContent[3]); //new WebDriverWait(driver, 20).until(ExpectedConditions.elementToBeClickable(By.xpath("//input[@class='ember-text-field ember-view' and @id='tokenString'][@name='tokenString']"))).sendKeys("GXXFV-CPMKR-VQVFV-2CCFD-J47GZ"); //driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(20)); //driver.elementToBeClickable(By.xpath("//input[@class='ember-text-field ember-view' and @id='tokenString'][@name='tokenString']"))); // WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(20)); // By elem_dynamic = By.name("tokenString"); // wait.until(ExpectedConditions.presenceOfElementLocated(elem_dynamic)); // driver.findElement(By.name("tokenString")).sendKeys(fileContent[3]);

Element code in the page

discussion design code-formatting javascript



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source