/** Qmetry ID: 102084 Check the same name when accessed via WEBDAV */
  @Test
  public void test02_CheckTheSameNameWhenAccessedViaWEBDAV() {
    String filePath = "TestData/test.txt";
    By eFile = By.xpath(siteExp.ELEMENT_DOCUMENT_TITLE.replace("${title}", "test.txt"));
    String newFileName = "rename02";
    By editFile =
        By.xpath(siteExp.ELEMENT_DOCUMENT_TITLE.replace("${title}", newFileName + ".txt"));

    info("-- Test case: Check the same name when accessed via WEBDAV --");

    // Go to Personal Drive
    navToolBar.goToPersonalDocuments();
    magDrv.addView2Drive("Web", "Personal Documents");
    navToolBar.goToSiteExplorer();
    actBar.chooseDrive(ecms.ELEMENT_PERSONAL_DRIVE);

    // Test Data > Upload a file: filename.txt
    // ecms.uploadFile(filePath);
    if (waitForAndGetElement(ecms.ELEMENT_ACTION_BAR_UPLOAD_BTN, DEFAULT_TIMEOUT, 2000, 0)
        == null) {
      info("click on More link");
      click(ecms.ELEMENT_MORE_LINK_WITHOUT_BLOCK);
      info("click upload button");
      click(ecms.ELEMENT_ACTION_BAR_UPLOAD_BTN);
    } else click(ecms.ELEMENT_ACTION_BAR_UPLOAD_BTN);
    uploadFileUsingRobot(filePath);

    // Rename a file
    // cMenu.contextMenuAction(eFile, cMenu.ELEMENT_MENU_RENAME_NODE, newFileName);
    // right click on eFile
    rightClickOnElement(eFile);

    // Rename a file and click [Cancel Button]
    waitForAndGetElement(cMenu.ELEMENT_MENU_RENAME_NODE, 3000);
    click(cMenu.ELEMENT_MENU_RENAME_NODE, 3000);
    type(cMenu.ELEMENT_INPUT_RENAME_NODE, newFileName, true);
    button.rename();
    waitForAndGetElement(editFile);

    // View information
    cMenu.contextMenuAction(editFile, cMenu.ELEMENT_VIEW_INFORMATION);
    waitForAndGetElement(
        cMenu.ELEMENT_POPUP_VIEW_INFORMATION_NAME.replace("${fileName}", newFileName + ".txt"));
    button.close();

    // Download and Allow Edition
    cMenu.contextMenuAction(editFile, cMenu.ELEMENT_MENU_DOWNLOAD);
    switchToNewWindow();

    // The url of the browser should end by rename02.txt
    String fileName = Utils.getFileNameFromCurrentUrl(driver);
    assert fileName.equals(newFileName + ".txt")
        : "Failed: check the same name when accessed via WEBDAV";

    // Restore data
    switchToParentWindow();
    cMenu.deleteDocument(editFile);
  }