Bug
How do I wait for an element that exists in a page for API Call
My Testcase failed if the element is not present at that time
Click a button, It goes to the next page, I wanna click a button there. But that button would be shown after five minutes(API call).
Tested page URL:
Test code
const activityBtn = Selector('#getstartedHBtn');
test('TestReport', async t => {
await t
.click(".btn.deploy.right")
const activityBtnElement1 = await activityBtn.with({ visibilityCheck: true })()
.click(activityBtn)
});
Hi @raja1313, I guess you should specify the timeout option for the Selector of the button.
Hi @AndreyBelym, The time varies for every run of test cases.
For Example: In my case, The button only displayed when the status got 200. Here I wanna wait for the button to be visible and then click, But testcafe doesn't wait for too much of time, How can I handle for this situations?
Thanks in advance!
@raja1313 : testcafe snippets might help you to handle your business case correctly
@raja1313
Please specify the timeout option for the Selector of your button.
const button = Selector('you button selector', { timeout: 60000});
await t.click(button);
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs or feature requests. For TestCafe API, usage and configuration inquiries, we recommend asking them on StackOverflow.
Most helpful comment
@raja1313 : testcafe snippets might help you to handle your business case correctly