dimanche 17 novembre 2019

How to handle error: Element not intractable

In the below code I cannot send email keys in the email text field, I tried clicking the field, clearing the field and sending the keys.

Script:

@When("enter below givem emails")
public void enter_below_givem_emails(DataTable CcContact) throws InterruptedException {

    List<String> CcEmail = CcContact.asList();

    System.out.println("Added email is: " +CcEmail.get(0));
    String CcEmails = CcEmail.get(0);

// wait.until(ExpectedConditions.numberOfElementsToBeLessThan(By.id("txtCCContactEmail"), 3)); //wait.until(ExpectedConditions.presenceOfElementLocated(By.xpath("//input[@id='txtCCContactEmail']"))).sendKeys(CcEmail.get(0));

Thread.sleep(3000); //wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div[@id='tabCCEmail']//div[@class='col-md-8']"))).sendKeys(CcEmails);

wait.until(ExpectedConditions.visibilityOfElementLocated(By.name("CCContactEmail"))).sendKeys(CcEmails); wait.until(ExpectedConditions.numberOfElementsToBeLessThan(By.id("AddSupportContact"), 2)); wait.until(ExpectedConditions.presenceOfElementLocated(By.id("AddSupportContact"))).click();

}

I am getting Error in wait.until(ExpectedConditions.visibilityOfElementLocated(By.name("CCContactEmail"))).sendKeys(CcEmails);

which throws the error:

org.openqa.selenium.TimeoutException: Expected condition failed: waiting for visibility of element located by By.name: CCContactEmail (tried for 120 second(s) with 500 milliseconds interval) Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'KAYS-WS-27', ip: '10.0.0.148', os.name: 'Windows 8.1', os.arch: 'amd64', os.version: '6.3', java.version: '1.8.0_211' Driver info: org.openqa.selenium.chrome.ChromeDriver Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 78.0.3904.97, chrome: {chromedriverVersion: 77.0.3865.40 (f484704e052e0..., userDataDir: C:\Users\aman.k\AppData\Loc...}, goog:chromeOptions: {debuggerAddress: localhost:49857}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: XP, platformName: XP, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify} Session ID: e899e305d22c599aed13bcc98bd1bcca at org.openqa.selenium.support.ui.WebDriverWait.timeoutException(WebDriverWait.java:95) at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:272) at com.stepDefinition.CreateTicket.enter_below_givem_emails(CreateTicket.java:291) at ?.enter below givem emails(file:/E:/CSGWorkspace/SupportTicket/src/test/resources/Features/CreateTicket.feature:38)

Then added emails will be selected as Cc contact     # CreateTicket.added_emails_will_be_selected_as_Cc_contact()

FAILED

It also throws an error: element not interactable, if I minimize the wait time.

Aucun commentaire:

Enregistrer un commentaire