Dynamic page redirects in TestCafe

by Steve French in Test Cafe Studio on June 2, 2021

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();