How to locate/click selector (button) using testcafeHow do JavaScript closures work?How do I detect a click outside an element?Trigger a button click with JavaScript on the Enter key in a text boxHow do I check if an element is hidden in jQuery?How do I remove a property from a JavaScript object?How to get the children of the $(this) selector?<button> vs. <input type=“button” />. Which to use?How do I redirect to another webpage?How to check whether a string contains a substring in JavaScript?How do I remove a particular element from an array in JavaScript?

Parameterize chained calls to a utility program in Bash

How dangerous are set-size assumptions?

How does a pilot select the correct ILS when the airport has parallel runways?

Explain why a line can never intersect a plane in exactly two points.

What happens to Cessna electric flaps that are moving when power is lost?

Hot coffee brewing solutions for deep woods camping

Can any NP-Complete Problem be solved using at most polynomial space (but while using exponential time?)

How to avoid voltage drop when using full bridge rectifier as reverse polarity protection

How many people are necessary to maintain modern civilisation?

Array initialization optimization

Do I have any obligations to my PhD supervisor's requests after I have graduated?

Find the C-factor of a vote

How large would a mega structure have to be to host 1 billion people indefinitely?

What was the Shuttle Carrier Aircraft escape tunnel?

How to remove this component from PCB

How do I professionally let my manager know I'll quit over smoking in the office?

Can there be an UN resolution to remove a country from the UNSC?

What does it mean to "control target player"?

Does this Wild Magic result affect the sorcerer or just other creatures?

Can someone suggest a path to study Mordell-Weil theorem for someone studying on their own?

.NET executes a SQL query and Active Monitor shows multiple rows blocking each other

What does "play with your toy’s toys" mean?

Why do textbooks often include the solutions to odd or even numbered problems but not both?

How can I politely work my way around not liking coffee or beer when it comes to professional networking?



How to locate/click selector (button) using testcafe


How do JavaScript closures work?How do I detect a click outside an element?Trigger a button click with JavaScript on the Enter key in a text boxHow do I check if an element is hidden in jQuery?How do I remove a property from a JavaScript object?How to get the children of the $(this) selector?<button> vs. <input type=“button” />. Which to use?How do I redirect to another webpage?How to check whether a string contains a substring in JavaScript?How do I remove a particular element from an array in JavaScript?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








1















I am trying to test the submission of an application using testcafe. However, I don’t seem to be able to get testcafe to click the ‘Submit Application’.



I have tried the following so far:



.click(Selector('button').withText('Submit Applicaition'))
.click('#submit-application').withText('Submit Application')


And a few more options.



I cannot even get testcafe to find the button



import Selector from 'testcafe';

fixture `MES login`
.page `http://mes.coeo.com.au/`;

test('FindButton', async t =>

await t
.wait(2000)
.navigateTo('/le12625-senior-exploration-geologist')
.wait(2000);

const one = await Selector('#submit-application');

const two = one.exists;

await t
.expect(two).ok()

await t
.wait(5000)
.click(Selector(one));



Can anyone give me a hand, explaining whether it is my testcafe script or the way the website is built and how I can make testcafe click the button?



Thanks a lot.



Link to site










share|improve this question



















  • 1





    Your test is working for me, though clicking the button does trigger a javascript error. Can you also add the error you're getting when the test fails?

    – lostlemon
    Mar 25 at 12:41

















1















I am trying to test the submission of an application using testcafe. However, I don’t seem to be able to get testcafe to click the ‘Submit Application’.



I have tried the following so far:



.click(Selector('button').withText('Submit Applicaition'))
.click('#submit-application').withText('Submit Application')


And a few more options.



I cannot even get testcafe to find the button



import Selector from 'testcafe';

fixture `MES login`
.page `http://mes.coeo.com.au/`;

test('FindButton', async t =>

await t
.wait(2000)
.navigateTo('/le12625-senior-exploration-geologist')
.wait(2000);

const one = await Selector('#submit-application');

const two = one.exists;

await t
.expect(two).ok()

await t
.wait(5000)
.click(Selector(one));



Can anyone give me a hand, explaining whether it is my testcafe script or the way the website is built and how I can make testcafe click the button?



Thanks a lot.



Link to site










share|improve this question



















  • 1





    Your test is working for me, though clicking the button does trigger a javascript error. Can you also add the error you're getting when the test fails?

    – lostlemon
    Mar 25 at 12:41













1












1








1








I am trying to test the submission of an application using testcafe. However, I don’t seem to be able to get testcafe to click the ‘Submit Application’.



I have tried the following so far:



.click(Selector('button').withText('Submit Applicaition'))
.click('#submit-application').withText('Submit Application')


And a few more options.



I cannot even get testcafe to find the button



import Selector from 'testcafe';

fixture `MES login`
.page `http://mes.coeo.com.au/`;

test('FindButton', async t =>

await t
.wait(2000)
.navigateTo('/le12625-senior-exploration-geologist')
.wait(2000);

const one = await Selector('#submit-application');

const two = one.exists;

await t
.expect(two).ok()

await t
.wait(5000)
.click(Selector(one));



Can anyone give me a hand, explaining whether it is my testcafe script or the way the website is built and how I can make testcafe click the button?



Thanks a lot.



Link to site










share|improve this question
















I am trying to test the submission of an application using testcafe. However, I don’t seem to be able to get testcafe to click the ‘Submit Application’.



I have tried the following so far:



.click(Selector('button').withText('Submit Applicaition'))
.click('#submit-application').withText('Submit Application')


And a few more options.



I cannot even get testcafe to find the button



import Selector from 'testcafe';

fixture `MES login`
.page `http://mes.coeo.com.au/`;

test('FindButton', async t =>

await t
.wait(2000)
.navigateTo('/le12625-senior-exploration-geologist')
.wait(2000);

const one = await Selector('#submit-application');

const two = one.exists;

await t
.expect(two).ok()

await t
.wait(5000)
.click(Selector(one));



Can anyone give me a hand, explaining whether it is my testcafe script or the way the website is built and how I can make testcafe click the button?



Thanks a lot.



Link to site







javascript button automated-tests e2e-testing testcafe






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 26 at 7:50









Alex Skorkin

2,57221837




2,57221837










asked Mar 25 at 8:45









MilkaMilka

82




82







  • 1





    Your test is working for me, though clicking the button does trigger a javascript error. Can you also add the error you're getting when the test fails?

    – lostlemon
    Mar 25 at 12:41












  • 1





    Your test is working for me, though clicking the button does trigger a javascript error. Can you also add the error you're getting when the test fails?

    – lostlemon
    Mar 25 at 12:41







1




1





Your test is working for me, though clicking the button does trigger a javascript error. Can you also add the error you're getting when the test fails?

– lostlemon
Mar 25 at 12:41





Your test is working for me, though clicking the button does trigger a javascript error. Can you also add the error you're getting when the test fails?

– lostlemon
Mar 25 at 12:41












1 Answer
1






active

oldest

votes


















4














Try this solution:



test('FindButton', async t => 
const submitButton = Selector('div#submit-application');
await t
.navigateTo('/le12625-senior-exploration-geologist')
.expect(submitButton.with(visibilityCheck: true).exists)
.ok(timeout: 30000)
.hover(submitButton)
.click(submitButton);

);


and add the --skip-js-errors to the TestCafe command-line options, because when you submit without inputing any field, there is an error on line console.log(this.state.data['State'].value); due to the fact that this.state.data is an empty object






share|improve this answer

























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55334016%2fhow-to-locate-click-selector-button-using-testcafe%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    4














    Try this solution:



    test('FindButton', async t => 
    const submitButton = Selector('div#submit-application');
    await t
    .navigateTo('/le12625-senior-exploration-geologist')
    .expect(submitButton.with(visibilityCheck: true).exists)
    .ok(timeout: 30000)
    .hover(submitButton)
    .click(submitButton);

    );


    and add the --skip-js-errors to the TestCafe command-line options, because when you submit without inputing any field, there is an error on line console.log(this.state.data['State'].value); due to the fact that this.state.data is an empty object






    share|improve this answer



























      4














      Try this solution:



      test('FindButton', async t => 
      const submitButton = Selector('div#submit-application');
      await t
      .navigateTo('/le12625-senior-exploration-geologist')
      .expect(submitButton.with(visibilityCheck: true).exists)
      .ok(timeout: 30000)
      .hover(submitButton)
      .click(submitButton);

      );


      and add the --skip-js-errors to the TestCafe command-line options, because when you submit without inputing any field, there is an error on line console.log(this.state.data['State'].value); due to the fact that this.state.data is an empty object






      share|improve this answer

























        4












        4








        4







        Try this solution:



        test('FindButton', async t => 
        const submitButton = Selector('div#submit-application');
        await t
        .navigateTo('/le12625-senior-exploration-geologist')
        .expect(submitButton.with(visibilityCheck: true).exists)
        .ok(timeout: 30000)
        .hover(submitButton)
        .click(submitButton);

        );


        and add the --skip-js-errors to the TestCafe command-line options, because when you submit without inputing any field, there is an error on line console.log(this.state.data['State'].value); due to the fact that this.state.data is an empty object






        share|improve this answer













        Try this solution:



        test('FindButton', async t => 
        const submitButton = Selector('div#submit-application');
        await t
        .navigateTo('/le12625-senior-exploration-geologist')
        .expect(submitButton.with(visibilityCheck: true).exists)
        .ok(timeout: 30000)
        .hover(submitButton)
        .click(submitButton);

        );


        and add the --skip-js-errors to the TestCafe command-line options, because when you submit without inputing any field, there is an error on line console.log(this.state.data['State'].value); due to the fact that this.state.data is an empty object







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 25 at 21:41









        hdorgevalhdorgeval

        2,556213




        2,556213





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55334016%2fhow-to-locate-click-selector-button-using-testcafe%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

            은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현