How To Read Data From JSON File In Playwright | Data Driven Test In Playwright

  Рет қаралды 9,998

Mukesh otwani

Mukesh otwani

Күн бұрын

Пікірлер: 33
@The4m3r
@The4m3r Жыл бұрын
This is great, finally something in a pool of playwright videos accross youtube, useful not just click and type, we need more content like this. Thank you
@Mukeshotwani
@Mukeshotwani Жыл бұрын
Thank you ☺️🙏
@shreyanshjain4519
@shreyanshjain4519 Жыл бұрын
Looking forward to more such videos 🙂
@Mukeshotwani
@Mukeshotwani Жыл бұрын
Which data source you are using for test data?
@shreyanshjain4519
@shreyanshjain4519 Жыл бұрын
Hi Mukesh, Thank you for this video :-) I am going through it completed watching till starting 10 mins. Just wanted to mention here that I was able to read the data from the json file using the below line of code. const testData = require("../test-data/readjson.json"); (did not use JSON.stringify and JSON.parse)
@Mukeshotwani
@Mukeshotwani Жыл бұрын
Great Shreyansh , how are you using that data in your script ? Can you try and let me know the results.
@rifattaque7301
@rifattaque7301 11 ай бұрын
@@Mukeshotwani yes we don't need the parsing and stringifying the data to access it. you just simply import the json file and then use dot notation to access it like you did in the video.
@rathishramankutty302
@rathishramankutty302 10 ай бұрын
I guess why we do the .parse and .stringify is to convert a jscript object into json and viseversa. in fact the data is already in json body so doesnt needed to do the manipulation there@@Mukeshotwani
@Rana-Farhan
@Rana-Farhan 6 ай бұрын
This channel require more views and subscribers.
@Mukeshotwani
@Mukeshotwani 6 ай бұрын
Thank you Rana
@gadulayuvasaisantosh9036
@gadulayuvasaisantosh9036 Жыл бұрын
hi Mukesh had a query .. rather than giving input data , can you please explain faker integration for randomly generating ids if we have a scenario for signing up multiple ids Thanks..
@Mukeshotwani
@Mukeshotwani 11 ай бұрын
You can use below faker module www.npmjs.com/package/@faker-js/faker
@MidnightMemories17
@MidnightMemories17 Ай бұрын
Very Helpful.
@Mukeshotwani
@Mukeshotwani Ай бұрын
Glad it was helpful!
@shreevallinataraj4500
@shreevallinataraj4500 9 ай бұрын
Hi Mukesh, i tried using this in my project but i am getting the error for using describe, could you please suggest me Error: Playwright Test did not expect test.describe() to be called here. Most common reasons include: - You are calling test.describe() in a configuration file. - You are calling test.describe() in a file that is imported by the configuration file. - You have two different versions of @playwright/test. This usually happens when one of the dependencies in your package.json depends on @playwright/test.
@sivaramakrishnareddyrajula9605
@sivaramakrishnareddyrajula9605 11 ай бұрын
Hi Mukesh, I have multiple different sets of data having key value pairs stored in a const array, I need to read data using key. Can you help me to read data using key?
@Mukeshotwani
@Mukeshotwani 11 ай бұрын
Its very easy basically same data we are reading from JSON. In case you want to keep in array then u can use direct array. Recommendation is not to hardcode test data.
@sivaramakrishnareddyrajula9605
@sivaramakrishnareddyrajula9605 10 ай бұрын
Thank you for your reply. I am getting this TypeError: testdata is not iterable playwright. However, this video really helps me. FYI, I used counter before for loop and incremented counter in loop as I have 1600+ records in json file which are generating from excel source.
@ganeshs4651
@ganeshs4651 5 ай бұрын
Hi Mukesh, I couldn't find your video for API Rest testing using Playwright for complex Json payload. Could you please share the link or create a new video for the same?
@Mukeshotwani
@Mukeshotwani 4 ай бұрын
Hi Ganesh, I need to create API with playwright. As of now I dont have playwright with API test.
@radhikapalaniyappan7174
@radhikapalaniyappan7174 3 ай бұрын
Hi Mukesh, I have tried the same way for fetching locators and test data,locators is working fine but test data I am getting error belo: Locator.fill:value: expected string,got undefined
@Mukeshotwani
@Mukeshotwani 3 ай бұрын
Hi Rahika, please make sure you are passing the valid argument from test while calling the best.
@arpitlahoti6086
@arpitlahoti6086 5 ай бұрын
Hi Mukesh I have done this same in my playwright and it works perfectly fine now I need to achieve clicking on a login as well and see every time It takes the new user from json file and login into the url so if any user is blocked or locked it can throw an error - how do I do that ? Please assist
@Mukeshotwani
@Mukeshotwani 4 ай бұрын
You can do DDT in playwright
@rakeshmahuli
@rakeshmahuli 2 ай бұрын
Hi Mukesh, when I use require and provide path, I am getting error like “ can’t find this module”. Stuck on this badly, how to resolve this? I know you must be busy but I would be so happy if you or anyone can help me out here
@Mukeshotwani
@Mukeshotwani 2 ай бұрын
Hi Rakesh, you can clone this repo for the setup github.com/Mukesh-50/playwright-testing-on-cloud with page object model - github.com/Mukesh-50/playwright-testing-on-cloud-pom
@harithay2127
@harithay2127 10 ай бұрын
Hi Mukesh it is such a great video, could you please provide code snippets and I will do practice on this code
@harithay2127
@harithay2127 10 ай бұрын
I tried your code but still I am getting errors like duplicate test
@Leader977
@Leader977 10 ай бұрын
Thank you a lot!
@Mukeshotwani
@Mukeshotwani 9 ай бұрын
You're welcome!
@3VAudioVideo
@3VAudioVideo 4 ай бұрын
I love this video so much! I am doing Data Driven testing, but need to use a MySQL db. I can create a method / function to return records and have it For loop code in a regular test, but I cannot get it loop on the inner Test . describe like you did at around 30:55 I can do it using a csv file, but not MySQL. I even tried putting the mysql calls just above the For loop and it did not work there (but the csv code there worked, as well as where you had it above the outer test . describe. Could you please help out? Thanks in advance!
@goranstojanovski7471
@goranstojanovski7471 10 ай бұрын
HI Mukesh, Great video, but it would be more interesting and advanced if you record a video for creation new user using random method for each field. Have a nice day :)
@Mukeshotwani
@Mukeshotwani 10 ай бұрын
Noted, will be recording soon.
Playwright #48 Data Driven Testing using CSV File in Playwright
13:41
SIZE DOESN’T MATTER @benjaminjiujitsu
00:46
Natan por Aí
Рет қаралды 5 МЛН
Чистка воды совком от денег
00:32
FD Vasya
Рет қаралды 3,5 МЛН
快乐总是短暂的!😂 #搞笑夫妻 #爱美食爱生活 #搞笑达人
00:14
朱大帅and依美姐
Рет қаралды 13 МЛН
Python JSON Parsing: A Step-by-Step Guide to Extract Data from JSON
14:27
Automate with Rakesh
Рет қаралды 23 М.
Playwright - How to maximize browser window
3:51
Slava Bulba
Рет қаралды 170
Mastering Playwright | Data Driven Testing | JSON | CSV | QA Automation Alchemist
10:34
Page Object Model In Playwright With JavaScript
41:48
Mukesh otwani
Рет қаралды 10 М.
Selenium Cucumber Java BDD Framework 5 - Parameterization & Data Driven Testing
16:23
How to test and monitor your APIs with Playwright
9:51
Checkly
Рет қаралды 8 М.
Playwright #47 Data Driven Testing using JSON File in Playwright
11:27
SIZE DOESN’T MATTER @benjaminjiujitsu
00:46
Natan por Aí
Рет қаралды 5 МЛН