LeanFT IHM automation - Focus mouse

0

My project is to automate IHM. Bug scenario:

  1. Click on the link
  2. A pop-up window will appear, click on the "Select file ..." button.
  3. The Windows framework (windows 10) is opened to select the file locally and click on "Open" The problem is that the mouse cannot click on the "Select file ..." button.

Code:

   public void leFichierDImportEstChoisi() throws Throwable {
        RadioGroup fileSource = browser.describe(RadioGroup.class, new RadioGroupDescription.Builder()
                .name("fileLocation")
                .tagName("INPUT").build());

        fileSource.select("1");

        WebElement fileFieldText = browser.describe(WebElement.class, new WebElementDescription.Builder()
                .innerText("Select File...")
                .tagName("SPAN").build());

        FileField fileField = browser.describe(FileField.class, new FileFieldDescription.Builder()
                .name("file")
                .tagName("INPUT").build());

    
        Mouse.click(fileFieldText.getLocation());
        fileField.setValue(importFilePath + importFileName);

        Button uploadButton = browser.describe(Button.class, new ButtonDescription.Builder()
                .buttonType("button")
                .name("Upload")
                .tagName("BUTTON").build());

        uploadButton.click();
    }

Error :

com.hp.lft.sdk.ReplayObjectNotFoundException: Exception de HRESULT : 0x80040202
    at com.hp.lft.sdk.internal.ReplayExceptionFactory$1.create(ReplayExceptionFactory.java:35)
    at com.hp.lft.sdk.internal.ReplayExceptionFactory.createOrDefault(ReplayExceptionFactory.java:289)
    at com.hp.lft.sdk.internal.ReplayExceptionFactory.createOrDefault(ReplayExceptionFactory.java:22)
    at com.hp.lft.sdk.internal.TestObjectExecuterBehaviorBase$ReplayErrorHandler.onError(TestObjectExecuterBehaviorBase.java:65)
    at com.hp.lft.sdk.internal.CommunicationClientImpl.handleError(CommunicationClientImpl.java:221)
    at com.hp.lft.sdk.internal.CommunicationClientImpl.send(CommunicationClientImpl.java:96)
    at com.hp.lft.sdk.internal.TestObjectExecuterBehavior.executeMethod(TestObjectExecuter.java:33)
    at com.hp.lft.sdk.internal.TestObjectBase.executeMethod(TestObjectBase.java:124)
    at com.hp.lft.sdk.internal.web.WebEditFieldBase.access$000(WebEditFieldBase.java:8)
    at com.hp.lft.sdk.internal.web.WebEditFieldBase$1.invoke(WebEditFieldBase.java:20)
    at com.hp.lft.sdk.internal.TestObjectOperationWrapper.executeWithEvents(TestObjectOperationWrapper.java:81)
    at com.hp.lft.sdk.internal.TestObjectOperationWrapper.executeWithEvents(TestObjectOperationWrapper.java:102)
    at com.hp.lft.sdk.internal.web.WebEditFieldBase.setValue(WebEditFieldBase.java:24)
    at Tests.DMTImport.leFichierDImportEstChoisi(DMTImport.java:222)
    at ✽.When le fichier d'import est choisi(DMTImport.feature:17)

at Tests.DMTImport.leFichierDImportEstChoisi(DMTImport.java:222) is :  fileField.setValue(importFilePath + importFileName);

Thanks in advance for help

java
leanft
asked on Stack Overflow Mar 18, 2021 by Bilel Bensalem • edited Mar 19, 2021 by bsheps

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0