Hi,
I want to navigate 2-3 pages in my application after login and capture data only after last button click (it can be a form submission or can take user to next page). I used logData 1 only before last page but WPT could not capture any data. The message I got is “Test completed successfully but could not capture data”.
After reading other threads, I tried using combineSteps. With that script gives the result of multiple steps. If I want to capture data only after a button click then neither logdata nor combineSteps is helping.
For example my requirement is
- Navigate to login page and login with valid credentials.
- Click on a tab/menu item on page. This will open a new page or load a new iFrame.
- Fill up from data in this page/iFrame and submit.
Thanks,
Bhavesh
Do you have an example of your actual script (with sensitive data removed)? combinesteps should let you see the full sequence just to make sure all of the steps are working as expected and if they are, logData should have no problem.
Thanks for your response Patrick!
I’m trying below two scripts. I have put junk for site and form data. When I run the scripts on private WPT instance, I can see script running till last step correctly. But after waiting for so long I get error “Test run successfully but could not capture the data”
Script 1:
setActivityTimeout 10000
logData 0
navigate http://my-site-login-page.com
sleep 10
exec document.querySelector(“#first_name”).value=‘dfaf’;
exec document.querySelector(“#last_name”).value=‘pdafaerf’;
exec document.querySelector(“#company”).value=‘Idfafsaf’;
exec document.querySelector(“#address_line1”).value=‘1fdaf’;
exec document.querySelector(“#country”).options[1].selected=true;
exec document.querySelector(“#city”).value=‘Mdfaa’;
exec document.querySelector(“#state”).options[6].selected=true;
exec document.querySelector(“#zipcode”).value=‘91234’;
exec document.querySelector(“#phone”).value=‘444-444-4444’;
exec document.querySelector(“#email”).value=‘cfdajfka@afbad.com’;
logData 1
execAndWait document.querySelector(“#billing > div.clearfix > a”).click();
Script 2
setActivityTimeout 10000
logData 0
navigate http://my-site-login-page.com
exec document.querySelector(“[name=‘login’]”).value=‘validuserid’;
exec document.querySelector(“[name=‘password’]”).value=‘validpassword’;
exec document.querySelector(“[id=‘LoginButton’]”).click();
sleep 15
exec document.querySelector(“a[class=‘employees’] > span”).click();
sleep 15
logData 1
exec document.querySelector(“div[class=‘lists employees’] > div.page-content > div.floatRight > button”).click();
Thanks,
Bhavesh
Script 2 needs the last command to be an execAndWait but that’s the only thing that jumps out at me. Script 1 looks like it should work fine.
I tried both the versions execAndWait and exec. But none worked.
All the clicks and navigation works fine though.