1

Thanks for your time.

Everything goes well as planned with testcafe. But am unable to figured the issue which am facing--i opened a modal-dialog box(it should be pop up window-- which has some info form filled and save it). which i had already solved it -- but here action URL is confusing the testcafe

HTML below shows..

enter image description here.

When i run it, the modal dialog opened and replaced(in 2s) as main page URL with black and white window and executed (with out saving- because div element different).

  1. how can open my modal dialog as popup window and fill the form and save it.
  2. How can close the window (can see the image- class=btn btn-white", here there is no name field as save-item button.

my code testcafe code (problem lays)

export async function test() {
   // open urls by click functions here
//required page was opened and searching the user exists or not
    const searchUserExists = 'user1'
    await t.typeText('[type="search"]', searchUserExists);

    const firstNameUser = "UserFirstName"
    const lastNameUser = "UserLastName"
    const emailUser = "moderator@moderator.de"
    await t.debug().click(' #ent_administration_user_new, .modal-body, 
    [action="null"]')  // worked

**here problem comes**

    await t.typeText(Selector("#user_firstname"), firstNameUser)
        .typeText(Selector("#user_lastname"), lastNameUser)
        .typeText(Selector("#user_username"), searchUserExists)
        .typeText(Selector("#user_email"), emailUser)
        .click(".save-item");
}

I also want to solve in testcafe code rather than in css file or html

Using by JS and PHP.

  • And where is the code which produces the issue? Unless you'd provide something reproducible, you can complain a lot and voice lots of technical requirements, of which none counts as a question. – Martin Zeitler Apr 29 '21 at 14:07
  • @MartinZeitler Thanks for your reply. i added it. i hope you will get the idea what i am doing. – learningtakestime Apr 29 '21 at 14:34
  • It's difficult to say what went wrong based on the information you sent. Would you mind sharing a reproducible example? Also, I created a small test showing how to interact with a Bootstrap model using TestCafe: [Filling form in a Bootstrap modal window with TestCafe](https://gist.github.com/wentwrong/4f808bf25813e4114685600247811ba0). I hope it will be helpful. – wentwrong May 03 '21 at 10:11

0 Answers0