Current time: 06-19-2019, 07:13 AM Hello There, Guest! (LoginRegister)

Post Reply 
 
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not able to capture data after last click only
06-20-2015, 07:33 AM
Post: #1
Not able to capture data after last click only
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

1. Navigate to login page and login with valid credentials.
2. Click on a tab/menu item on page. This will open a new page or load a new iFrame.
3. Fill up from data in this page/iFrame and submit.

Thanks,
Bhavesh
Find all posts by this user
Quote this message in a reply
06-25-2015, 12:14 AM
Post: #2
RE: Not able to capture data after last click only
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.
Visit this user's website Find all posts by this user
Quote this message in a reply
06-25-2015, 05:14 AM
Post: #3
RE: Not able to capture data after last click only
(06-25-2015 12:14 AM)pmeenan Wrote:  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
Find all posts by this user
Quote this message in a reply
06-25-2015, 05:18 AM
Post: #4
RE: Not able to capture data after last click only
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.
Visit this user's website Find all posts by this user
Quote this message in a reply
06-30-2015, 07:02 AM
Post: #5
RE: Not able to capture data after last click only
(06-25-2015 05:18 AM)pmeenan Wrote:  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.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)