Test Cafe Studio

3 posts

Dynamic page redirects in TestCafe

So – you need to redirect to a dynamic page in TestCafe you say? Try the below const setValue = ClientFunction(() => {var idToUseForRedirection=document.querySelector(‘input[name=”ID”]’).value;document.location.href=”https://someurl.com?id=” + idToUseForRedirection; }); await setValue();

More Test Cafe Goodies

Generating a random string in some logical order const setValue = ClientFunction(() => {var dt = new Date();var dateString =”Steve French Test – ” + dt.getTime();document.querySelector(‘input[name=”ctl00$CPHSIURate$txtRiskName”]’).value =dateString;document.querySelector(‘input[name=”ctl00$CPHSIURate$txtRiskName”]’).dispatchEvent(new window.Event(‘change’, { bubbles: true }))}); await setValue(); as well as const setValue = ClientFunction(() => { document.querySelector(‘input[name=”CaptchaAgentValueAsSupplied”]’).value = document.querySelector(‘input[name=”CaptchaAgentValue”]’).value;});await setValue(); to play with dates const setValue = ClientFunction(() […]

How to fix problems with Test Cafe Studio and Datepickers

I’ve become quite a fan of Test Cafe Studio this past year – I’ve found it to be an excellent mix of automated testing and browser automation. One persistent problem I’ve had is how it treats the datepicker – specifically it works for one month, and then doesn’t work at all (due to the position […]