I'm getting a value in my jmeter script while login to the application through login.microsoft which is i19 help me progress to it

Viewed 27

While debugging it a function passes through that values which is

timeOnPage((new Date).getTime() - r.performance.timing.loadEventEnd)

Help me to approach it in jmeter and also if possible kindly attach any reference

'login': 'username', 'loginfmt': 'username, 'type': 11, 'LoginOptions': 3, 'passwd': 'passowrd', 'ps': 2, 'PPFT': 'DT7FcXvu1j5UZEuAijgCbCFp2h4S18Jax305PmmXq4RBn2umUYQdCHR4s56Hz4aXynR8ZMa5QFNZuV00lZuXeeafX5A5wOinjHd2FH1puqD3SC99!Axsw4MPfAYpMiWmMT!9bn68afs06auhdEfEgar2hAZb4h9ojYTsffyfsBJd2OylwhjssZ5tyYKmKSesCwz22NMgxA1iQtnoB7e372A3PEGXX96ZdnyttvGwfJc2DDYxSINr!MiBZ06BhQ$$', 'PPSX': 'P', 'NewUser': 1, 'fspost': 0, 'i21': 0, 'CookieDisclosure': 0, 'IsFidoSupported': 1, 'i2': 1, 'i17': 0, 'i18': '__ConvergedLoginPaginatedStrings|1,__OldConvergedLogin_PCore|1,__OldConvergedLogin_PAlt|1,', 'i19': 18430, }

headers = { 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8', 'Accept-Encoding': 'gzip, deflate, br', 'Accept-Language': 'en-US,en;q=0.9', 'Cache-Control': 'max-age=0', 'Connection': 'keep-alive', 'Cookie': 'CkTst=G1533539730122; uaid=560f12860bcc490b96b2b47b59d279b5; MSPRequ=lt=1533584411&id=292543&co=1; CkTst=G1533584432775; MSPOK=$uuid-a0d2394b-38e2-41f6-a594-75d2f6cd22e6$uuid-61ba4660-7580-4c5e-8efe-3b9b6a393c9e$uuid-5dddd33a-bf32-4b7e-9d55-fca1049943f9$uuid-92fc9fdc-b8ed-48bb-950d-7e5d0aa41417; wlidperf=FR=L&ST=1533584441597', 'Content-Length': '722', 'Content-Type': 'application/x-www-form-urlencoded', 'Host': 'login.live.com', 'Origin': 'https://login.live.com', 'Referer': 'https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=13&rver=6.7.6643.0&wp=SA_20MIN&wreply=https:%2f%2faccount.xbox.com%2fen-US%2fChangeGamertag&lc=1033&id=292543&aadredir=1', 'Upgrade-Insecure-Requests': '1', 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36', }

1 Answers

As per JMeter project main page:

JMeter is not a browser, it works at protocol level. As far as web-services and remote services are concerned, JMeter looks like a browser (or rather, multiple browsers); however JMeter does not perform all the actions supported by browsers. In particular, JMeter does not execute the Javascript found in HTML pages. Nor does it render the HTML pages as a browser does (it's possible to view the response as HTML etc., but the timings are not included in any samples, and only one sample in one thread is ever displayed at a time).

So if you're absolutely sure that you need to pass the current timestamp to the i19 input you can use __time() function which returns the current timestamp in milliseconds since the beginning of Unix epoch

enter image description here

More information on JMeter Functions concept: Apache JMeter Functions - An Introduction

Related