Part 2: Building API Automation Testing Framework in Rest Assured from from Scratch

  Рет қаралды 75,232

SDET- QA

SDET- QA

Күн бұрын

#apitesting #restassured #framework
@0:55 Continuing from part I
READING CREATED USER
@1:24 Create test method in "UserTests" class.
@2:37 Call a method from "UserEndPoints" class and pass other method in parameter in it using "This" keyword to use same username
@4:08 Store response in variable and log response in console
@4:38 Validate status code using assertions (correction @5:55)
@6:52 Execute the test
UPDATE USER
@9:15 Create test method.
@9:46 Copy the code from postUser test method into this method.
@10:35 Whichever the data to update we need to copy those Userpayload code.
@11:15 Rename the method to update the data and pass parameters in it using "This" keyword to use same username
@15:15 Log body in console
@15:54 Storing after update response in variable and validate status code using assertions (correction @19:16)
DELETE USER
@16:54 Create test method.
@17:35 Call a method from "UserEndPoints" class for same username using "This" keyword and store response in variable
@18:15 Validate status code using assertions
@23:14 Execute the test
DATA DRIVEN TEST
@24:32 Introduction
@26:19 Create a folder under same project and paste the excel sheet
@26:39 Opening excel sheet
@27:42 Update pom.xml with APACHE POI dependencies
@28:16 Paste the Excel utility file inside Utlities package
@35:25 Paste the Dataprovider file inside Utlities package
CREATE USER
@43:22 Create a class under "Test" package
@47:27 Create test method
@48:11 In test annotation, add priority, refer particular data provider and refer its class.
@50:45 Pass all variables related to user in parameters of test method
@53:36 Create object for POJO class
@54:09 Call all setter methods from POJO class and pass all variables related to user in parameters
@55:00 Call "Create user" method from "UserEndPoints" class, pass object for POJO class in parameter, store response in variable
and validate status code using assertion.
DELETE USER
@56:49 Create test method, in test annotation, add priority, refer particular data provider and refer its class.
@58:29 Pass username variable in parameter of test method
@58:51 Call "deleteuser" method from "UserEndPoints" class and pass username variable in parameter and store response in variable.
@59:24 Validate status code using assertions
@1:00:51 Execute the test
EXTENT REPORTS
@1:04:15 Update pom.xml with extent reports dependency
@1:04:29 Paste the extent reports utility file inside Utlities package
@1:11:52 Create testng.xml from Test package
@1:12:40 Disable data driven testcase in testng.xml
@1:13:20 Add extent reports tag inside testng.xml
@1:14:52 Execute testng.xml
@1:15:19 View reports
LOGGERS
@1:20:23 Add Apache log4j dependencies in pom.xml and update the project
@1:22:20 paste "log4j2.xml" in src/test/resources
@1:24:49 Create variable for logger class in test case class
@1:25:27 Initiate that variable in Beforeclass method for same class
@1:26:29 Adding logging messages in create user method and repeat for remaining methods.
@1:28:59 Execute the test
NOT WORKING WELL
@1:29:57 Change log levels in "log4j2.xml" for debug logs
@1:32:13 Call debug method in Beforeclass method
@1:32:32 Execute the test
Udemy Courses:
Manual Testing+Agile with Jira Tool
► shorturl.at/xNXZ4
Selenium with Java+Cucumber
► shorturl.at/aIKMW
Selenium with Python & PyTest
► shorturl.at/ELW09
Selenium with python using Robot framework
► shorturl.at/bcDPZ
API Testing(Postman, RestAssured & SoapUI)
► shorturl.at/uAWY7
Web & API Automation using Cypress with Javascript
► rb.gy/4uum2n
Playwright with Javascript
► rb.gy/4uum2n
Jmeter-Performance Testing
► rb.gy/ocj7r2
SDET Essencials(Full Stack QA)
► rb.gy/hlnf2v
Appium-Mobile Automation Testing
► rb.gy/wmzv64
Java Collections
► bit.ly/3S66ezE
Python Programming
► urlis.net/gdsfpb0s
Cucumber BDD Framework
► bit.ly/3F7d69r
Protractor with Javascript
► urlis.net/4uddm1qb
KZbin Playlists:
Manual Testing & Agile
► bit.ly/3ujvaYa
► bit.ly/3OYzxQj
SQL
► bit.ly/3R6XjeG
► bit.ly/3nE0a1s
► bit.ly/3IeKuuJ
linux & Shell Scripting
► bit.ly/3up1Z6a
► bit.ly/3nzvGxx
Java
► bit.ly/3R9QfOs
► bit.ly/3AoRMKM
► bit.ly/3IbTTDn
► bit.ly/3ybXInv
► bit.ly/3yCoHdw
Selenium With Java+Cucumber
► bit.ly/3P2FMm4
► bit.ly/3yhiIt4
► bit.ly/3uokzet
► bit.ly/3a7XIND
► bit.ly/3umN2S9
► bit.ly/3aar7GW
► bit.ly/3y9kD2S
► bit.ly/3uhLskn
Python
► bit.ly/3agNgU0
► bit.ly/3NJNnoy
► bit.ly/2CTQ4mR
► bit.ly/3OIYWh1
Selenium With Python,Pytest&Behave
► bit.ly/3OHHoC9
► bit.ly/3IeNLdv
► bit.ly/2J4tPeT
► bit.ly/3ydSkAq
Selenium With Python Using Robert Framework
(Web&API Testing)
► bit.ly/3nUvlpr
► bit.ly/3nUvE3z
GraphQL
► rb.gy/sj3gys

Пікірлер: 147
@deepakrai5175
@deepakrai5175 5 ай бұрын
This is the best tutorial of restassured framework with reporting , not only on KZbin but on the entire internet as I have followed multiple rest assured framework tutorials. Thanks Pawan sir !
@sdetpavan
@sdetpavan 5 ай бұрын
My Pleasure
@adityanarayan3325
@adityanarayan3325 11 ай бұрын
You're Great Sir. We don't have any words praise your work
@sdetpavan
@sdetpavan 11 ай бұрын
Thanks
@salemabraham6291
@salemabraham6291 4 ай бұрын
Thanks for giving us precious knowledge for free, Excellent explanation
@sdetpavan
@sdetpavan 4 ай бұрын
Welcome
@supriyabarai4905
@supriyabarai4905 Жыл бұрын
I can't find the XLUtility and DataProviders files in the videos. Anyway, I created and executed it successfully. XLUtility.java============== package api.utilities; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.DataFormatter; import org.apache.poi.xssf.usermodel.XSSFCell; import org.apache.poi.xssf.usermodel.XSSFRow; import org.apache.poi.xssf.usermodel.XSSFSheet; import org.apache.poi.xssf.usermodel.XSSFWorkbook; public class XLUtility { public FileInputStream fi; public FileOutputStream fo; public XSSFWorkbook workbook; public XSSFSheet sheet; public XSSFRow row; public XSSFCell cell; public CellStyle style; String path; public XLUtility(String path) { this.path=path; } public int getRowCount(String sheetName) throws IOException { fi=new FileInputStream(path); workbook=new XSSFWorkbook(fi); sheet=workbook.getSheet(sheetName); int rowcount=sheet.getLastRowNum(); workbook.close(); fi.close(); return rowcount; } public int getCellCount(String sheetName,int rownum) throws IOException { fi=new FileInputStream(path); workbook=new XSSFWorkbook(fi); sheet=workbook.getSheet(sheetName); row=sheet.getRow(rownum); int cellcount=row.getLastCellNum(); workbook.close(); fi.close(); return cellcount; } public String getCellData(String sheetName,int rownum,int colnum) throws IOException { fi=new FileInputStream(path); workbook=new XSSFWorkbook(fi); sheet=workbook.getSheet(sheetName); row=sheet.getRow(rownum); cell=row.getCell(colnum); DataFormatter formatter = new DataFormatter(); String data; try { data=formatter.formatCellValue(cell); } catch(Exception e) { data=""; } workbook.close(); fi.close(); return data; } public void setCellData(String sheetName,int rownum,int colnum,String data) throws IOException { File xlfile=new File(path); if(!xlfile.exists()) { workbook=new XSSFWorkbook(); fo=new FileOutputStream(path); workbook.write(fo); } fi=new FileInputStream(path); workbook=new XSSFWorkbook(fi); if(workbook.getSheetIndex(sheetName)==-1) workbook.createSheet(sheetName); sheet=workbook.getSheet(sheetName); if(sheet.getRow(rownum)==null) sheet.createRow(rownum); row=sheet.getRow(rownum); cell=row.createCell(colnum); cell.setCellValue(data); fo=new FileOutputStream(path); workbook.write(fo); workbook.close(); fi.close(); fo.close(); } } Dataproviders.java================= package api.utilities; import java.io.IOException; import org.testng.annotations.DataProvider; public class Dataproviders { @DataProvider(name="Data") public String[][] getAllData() throws IOException { String path=System.getProperty("user.dir")+"//testData//Userdata.xlsx"; XLUtility xl=new XLUtility(path); int rownum=xl.getRowCount("Sheet1"); int colcount=xl.getCellCount("Sheet1",1); String apidata[][]=new String[rownum][colcount]; for(int i=1;i
@kirankatkar4088
@kirankatkar4088 Жыл бұрын
Can you please help me
@michannelz
@michannelz Жыл бұрын
I got an error on the method "public String[] getUserNames() throws IOException", it's show explains like this "Data provider must return Object[][] or Iterator " can anyone help me?
@dagovf
@dagovf Жыл бұрын
Thank you so much!
@sivakumar7124
@sivakumar7124 Жыл бұрын
Thankyou so much..
@Bored-Panda
@Bored-Panda 11 ай бұрын
Thanks. did you manage to get the extent report utility code as well? If so, please can you share. Thanks in advance.
@keerthisyna3363
@keerthisyna3363 Ай бұрын
Thank you for the awesome and clear explanation. This tutorial made it easy for me to understand API testing☺
@xXMrThomasXx
@xXMrThomasXx 2 ай бұрын
My head is explode for the new knowledge xD Great tutorial :)
@amember1014
@amember1014 Жыл бұрын
Thank you Mr Pavan, excellent as usual!!!
@sdetpavan
@sdetpavan Жыл бұрын
Welcome
@HirenPrajapati0510
@HirenPrajapati0510 Күн бұрын
superb
@sdetpavan
@sdetpavan 3 сағат бұрын
Thanks
@user-jq2jg9fp3u
@user-jq2jg9fp3u Жыл бұрын
Sir you are giving best knowledge free of cost. Thanks its so much useful, could u please add the extentReporter class and log4j.xml files here?
@archanakulkarni1771
@archanakulkarni1771 3 сағат бұрын
Hello Sir, Thank you for creating such a wonderful course. Can I get this project code to understand it in a more better way ?
@Orderoll
@Orderoll 11 ай бұрын
Precious knowledge for free
@sdetpavan
@sdetpavan 11 ай бұрын
Thanks
@uday.7777
@uday.7777 Жыл бұрын
In POST request test data is not updated, It shows previous data only. Guys any one notice that Please check once
@user-zy7lq9tf7h
@user-zy7lq9tf7h 7 ай бұрын
good job bro
@shabanashabbu7420
@shabanashabbu7420 Ай бұрын
Hi Pawan sir ur teaching awesome
@sdetpavan
@sdetpavan Ай бұрын
Thanks
@rutujaadhav2916
@rutujaadhav2916 8 ай бұрын
this API framework series is awesome I want learn n create framework for testing web application using Selenium+java could you please share link for the same so that I can answer folder structure n framework related interview questions.
@gauravchavan2240
@gauravchavan2240 4 күн бұрын
excellent teaching.thanks mr. pavan. where can I get dataproviders class and excel utilities?
@mytranathkollipara5005
@mytranathkollipara5005 Жыл бұрын
informative and easy to understand. thank you, can you provide bitbucket link of this code if any.
@KevoStorm
@KevoStorm 7 ай бұрын
I have a question, what happend if we put the information in the body with no data like we send in the format Json. For example when we send a body usually we put like this: { "name" : "name", "last_name" : "lastname" } But when you send the body you don't specifye ("name", getName) so, thats means the programs took the data in order so, if a put getLastname in "userPayload.setFirstName(faker.name().lastName()); The program post like this { "name" : "lastname", "lastname" : "lastname" } I don't know if a explaind my self. Because if we don't send information in order that's mean the program took whatever you put in that order
@annanoop8150
@annanoop8150 Ай бұрын
thank you sir
@sdetpavan
@sdetpavan Ай бұрын
Most welcome
@nikhilbondarde
@nikhilbondarde Жыл бұрын
can we use scenario outline?? instead of DDT
@DD12756
@DD12756 Жыл бұрын
Pls help me someone... I'm using eclipse latest version and java 17 ... I'm not able to get the response....their is no mistake in code I'm following as it is pavan sir... So kindly suggest me the supported software versions
@yasinealbakir
@yasinealbakir 7 ай бұрын
Mr. Pavan, In the web service method I tested, it creates the Id value itself and returns it as a response. I want to save this value to Excel and use it in my next test scenario. How can I do this according to your structure?
@ronbarybaryosef2412
@ronbarybaryosef2412 7 ай бұрын
Mr. Pavan , great tutorial on building api infrastructure , where can we download this code from ? please provide a link , thanks
@vidhyamanickaraj5802
@vidhyamanickaraj5802 8 ай бұрын
Hi sir..Thanks for the excellent videos!Extent Report is not getting generated in folder..Anybody faced this issue?
@shekharadil3189
@shekharadil3189 Жыл бұрын
can you please share the data-provider and excel class file?
@postoronnii__
@postoronnii__ Жыл бұрын
What about negative scenarios?
@spidyniks
@spidyniks 5 ай бұрын
When run the test it is throwing error although code what sir has showed is same. Do we need to do anything?
@ravikanthbadam3527
@ravikanthbadam3527 Жыл бұрын
Part 3 when it will be available please
@prasadchavakula8451
@prasadchavakula8451 Жыл бұрын
Pavan sir, if we have more columns in the excel sheet, is there any approach other than sending arguments in the DDTest class methods?
@gowthamteja7146
@gowthamteja7146 6 ай бұрын
if you have more columns in the Excel sheet and you want to pass multiple values to your test methods, you can create custom objects or use a more complex data structure to represent the data from each row.
@MGdriver77
@MGdriver77 11 ай бұрын
I couldn't find the XLUtility file. So I paused the video and typed the whole thing, lol.
@MGdriver77
@MGdriver77 11 ай бұрын
Same for DataProviders. Also the @DataProvider (name="Data") annotation isn't working for me, had to comment it out so far
@user-in5wp8yo2i
@user-in5wp8yo2i 4 ай бұрын
Me to, good for practice anyway. 🙂
@SanoopAI
@SanoopAI 3 ай бұрын
I faced the same issue, how does it magically appear for him 😀
@AbdultaiyebSiyamwala
@AbdultaiyebSiyamwala Күн бұрын
Next time take a screenshot and ask chatgpt or gemini ai to provide a code for this. Will do this in 2 mins
@MGdriver77
@MGdriver77 Күн бұрын
@AbdultaiyebSiyamwala 11 months ago I didn't have chatgpt 4o, lol but will do in the future.
@itstechshow7747
@itstechshow7747 7 ай бұрын
Could you make videos API automation with python full course Thanks in advance
@victusha5426
@victusha5426 Жыл бұрын
sir please provide git link or code utilised in video link for practice purpose it will be very useful
@user-zy6sf3xl6c
@user-zy6sf3xl6c Жыл бұрын
Hello @pavan sir where we can get this utility files
@navitanagdive2595
@navitanagdive2595 6 ай бұрын
For me testcase method is running but its not generating data...could anyone please help me
@tusharsangale380
@tusharsangale380 Жыл бұрын
extend report is not generated sir in folders?
@SineQuaNon1
@SineQuaNon1 6 ай бұрын
Thanks a lot for this very useful series. But where are the files that you said you will share, like log4j, XlUtility etc ?
@Lets_Roam
@Lets_Roam 5 ай бұрын
get it from comments
@charlesvim
@charlesvim 7 ай бұрын
I have run the script and its failed. continuously getting "405 Not Allowed" error. can someone help in this.
@Shridhar_Giri
@Shridhar_Giri Жыл бұрын
Pavan, if u don't mind, oculd u please share the data provider file and excel utility file in this chat.
@sathyaprakashd3339
@sathyaprakashd3339 Жыл бұрын
Sir where did you get extent file scripts?
@rahulhirlekar6918
@rahulhirlekar6918 Жыл бұрын
Hello sir Can you provide utilities file , Data provider file ,Dataprovider access file file, apache poi class file
@shobhagarun5515
@shobhagarun5515 3 ай бұрын
Sir where do we find the documents and the XMLs of this API course class?
@Moe.firouzabadi
@Moe.firouzabadi Жыл бұрын
Hi! Where can I find the files for this project? Thanks!
@FunLife-je8qo
@FunLife-je8qo 6 ай бұрын
sir plz, it is any issue firstname and last name not generated (not showing in output)other id,email,phone number and password generated(showing)
@shridharnraykar1486
@shridharnraykar1486 Жыл бұрын
Sir can you make similar api automation video using python n pytest
@santhoshkumarnc6122
@santhoshkumarnc6122 Жыл бұрын
Where i can get the XL Utility file.
@nandakumarj-vy5qy
@nandakumarj-vy5qy 2 ай бұрын
is the base URL changed or path param definition changed? anyone please let me know
@arunprasadh6618
@arunprasadh6618 Жыл бұрын
@SDET- QA Automation Techie I'm using Mac with IntelliJIDEA., I'm doing everything very perfect as like in this video., but the aventstack extent report is not generated for me inside the reports folder as soon as the test is completed., but however the same code works fine for me in windows (with Same IntellijIDEA).., I've also enable R&W permission for the reports folder in Mac., but it's not worked out., Kindly help me out., Also pls if any of you knows the solution., kindly help me out
@puneetarora2804
@puneetarora2804 Жыл бұрын
unix takes forward slashes instead. try: sparkReporter = new ExtentSparkReporter(".//reports//" + repName);
@omsonawane9101
@omsonawane9101 8 ай бұрын
Hi Sir I have asked multiple time for course content/files/documents but did not get reply from you please provide all pdf and docs related postman and Rest assured course or upload It's really help for me and others also please provide your reply/comment
@R-user63
@R-user63 Жыл бұрын
Is this project available in Git??
@user-ve3zn6me9h
@user-ve3zn6me9h 5 ай бұрын
Hi, Can you upload the final project with the code here?
@user-no8ts3gp2q
@user-no8ts3gp2q Жыл бұрын
Hi all! Did anybody face any issues on getUserByUserName test? on my side it is failing with 404: User not found, even though I have done everything as in the video
@thundergaming1920
@thundergaming1920 Жыл бұрын
Same error I am also facing. Did you got the solution?
@hewigaurav
@hewigaurav 11 ай бұрын
Because you have to create a user first before finding it!
@santhoshk5741
@santhoshk5741 8 ай бұрын
I am also facing the same issue and I noticed that user is not created when you call post user method. { "code": 200, "type": "unknown", "message": "1950701640" }
@nehanivalkar5290
@nehanivalkar5290 6 ай бұрын
Ig its coz of authorisation As it can only be done by logged in user
@user-yz5jy1yl8z
@user-yz5jy1yl8z 4 ай бұрын
@@thundergaming1920 Hey bro did you get the solution for that?
@achyutkembhavi3204
@achyutkembhavi3204 Жыл бұрын
Sir please share the XML file in description
@arifmiah6288
@arifmiah6288 Жыл бұрын
sir can u provide github link for this project.
@FunLife-je8qo
@FunLife-je8qo 6 ай бұрын
firstname and lastname not showing in output
@farjanaaziz3984
@farjanaaziz3984 5 ай бұрын
Very good Tutorial. How can we get the code? is there any github code repo? Thanks
@piyushkotiyal9964
@piyushkotiyal9964 9 ай бұрын
sir when i run UserTests it fails & give error ----- FAILED: testUpdateUserByName java.lang.AssertionError: expected [200] but found [301],seems like endpoints not working
@priyadharshiniv5166
@priyadharshiniv5166 2 ай бұрын
Same for me how do you resolve
@HirenPrajapati0510
@HirenPrajapati0510 4 сағат бұрын
Can you please provide a file for Excel utility (Data Provider - code)
@user-zy7lq9tf7h
@user-zy7lq9tf7h 7 ай бұрын
Can any one, please share me the ExtentReportManager class
@amalkumar5201
@amalkumar5201 Жыл бұрын
Sir I want to join your session how I can join please suggest
@user-he5vc2vu5v
@user-he5vc2vu5v 11 ай бұрын
where can i find please help me
@prasannavenkatesan5140
@prasannavenkatesan5140 5 ай бұрын
public static String get_url = base_url+"/user/{username}"; - Not working not passing the name exactly
@anujadangeti5196
@anujadangeti5196 5 ай бұрын
Yes me also getting same error
@user-yz5jy1yl8z
@user-yz5jy1yl8z 4 ай бұрын
Hi bro did you get the solution for that? if yes, then how to solve that
@sumedhramteke9439
@sumedhramteke9439 Жыл бұрын
Anyone have github link for this project please share it
@ksdnsdkumar1375
@ksdnsdkumar1375 Жыл бұрын
@0:55 Continuing from part I READING CREATED USER @1:24 Create test method in "UserTests" class. @2:37 Call a method from "UserEndPoints" class and pass other method in parameter in it using "This" keyword to use same username @4:08 Store response in variable and log response in console @4:38 Validate status code using assertions (correction @5:55) @6:52 Execute the test UPDATE USER @9:15 Create test method. @9:46 Copy the code from postUser test method into this method. @10:35 Whichever the data to update we need to copy those Userpayload code. @11:15 Rename the method to update the data and pass parameters in it using "This" keyword to use same username @15:15 Log body in console @15:54 Storing after update response in variable and validate status code using assertions (correction @19:16) DELETE USER @16:54 Create test method. @17:35 Call a method from "UserEndPoints" class for same username using "This" keyword and store response in variable @18:15 Validate status code using assertions @23:14 Execute the test DATA DRIVEN TEST @24:32 Introduction @26:19 Create a folder under same project and paste the excel sheet @26:39 Opening excel sheet @27:42 Update pom.xml with APACHE POI dependencies @28:16 Paste the Excel utility file inside Utlities package @35:25 Paste the Dataprovider file inside Utlities package CREATE USER @43:22 Create a class under "Test" package @47:27 Create test method @48:11 In test annotation, add priority, refer particular data provider and refer its class. @50:45 Pass all variables related to user in parameters of test method @53:36 Create object for POJO class @54:09 Call all setter methods from POJO class and pass all variables related to user in parameters @55:00 Call "Create user" method from "UserEndPoints" class, pass object for POJO class in parameter, store response in variable and validate status code using assertion. DELETE USER @56:49 Create test method, in test annotation, add priority, refer particular data provider and refer its class. @58:29 Pass username variable in parameter of test method @58:51 Call "deleteuser" method from "UserEndPoints" class and pass username variable in parameter and store response in variable. @59:24 Validate status code using assertions @1:00:51 Execute the test EXTENT REPORTS @1:04:15 Update pom.xml with extent reports dependency @1:04:29 Paste the extent reports utility file inside Utlities package @1:11:52 Create testng.xml from Test package @1:12:40 Disable data driven testcase in testng.xml @1:13:20 Add extent reports tag inside testng.xml @1:14:52 Execute testng.xml @1:15:19 View reports LOGGERS @1:20:23 Add Apache log4j dependencies in pom.xml and update the project @1:22:20 paste "log4j2.xml" in src/test/resources @1:24:49 Create variable for logger class in test case class @1:25:27 Initiate that variable in Beforeclass method for same class @1:26:29 Adding logging messages in create user method and repeat for remaining methods. @1:28:59 Execute the test NOT WORKING WELL @1:29:57 Change log levels in "log4j2.xml" for debug logs @1:32:13 Call debug method in Beforeclass method @1:32:32 Execute the test
@tholeduc6499
@tholeduc6499 10 ай бұрын
Thanks bro, god bless you
@RohanKumar-vc5ii
@RohanKumar-vc5ii 5 ай бұрын
Hello Sir, where can I get the ExcelUtility.java file?
@saidacharym8012
@saidacharym8012 25 күн бұрын
Where your attaching files we are not able to find file sir
@Therealist16
@Therealist16 Жыл бұрын
@pavansdet Could you share XLutility file here
@user-oy2uf8dn5f
@user-oy2uf8dn5f Жыл бұрын
Can anyone provide the Extent Report class file
@venkatvenki246
@venkatvenki246 11 ай бұрын
Hi Anyone provide me the extent report manager class file
@veenaj4943
@veenaj4943 Жыл бұрын
Can you pls share excel utility file
@sakshiaggarwal6199
@sakshiaggarwal6199 Жыл бұрын
Sir please share Excel Utility file.
@DineshkumarS-gv2fb
@DineshkumarS-gv2fb 3 ай бұрын
Hi Sir,can you share the XLutilitie file sir that would be helpful for us
@sanammaharjan7556
@sanammaharjan7556 Жыл бұрын
where can i find utility file?
@user-he5vc2vu5v
@user-he5vc2vu5v 11 ай бұрын
have you XL utility and data provider file ? if yes please share with me
@suryagowda3663
@suryagowda3663 Жыл бұрын
Hi pavan sir, can u pls give me latest video in github repo link pls sir
@RohanKumar-vc5ii
@RohanKumar-vc5ii 5 ай бұрын
Sir, please can you share your github link so that I can download this code?
@user-zy6sf3xl6c
@user-zy6sf3xl6c Жыл бұрын
FAILED CONFIGURATION: @BeforeClass api.test.UserTests.setupdata java.lang.NullPointerException: Cannot invoke "api.payload.User.setId(int)" because "this.userpayload" is null i got this error after running suit .....i will follow same step as you mentioned
@sumedhramteke9439
@sumedhramteke9439 Жыл бұрын
Same here …did uh solve this issue ?
@user-zy6sf3xl6c
@user-zy6sf3xl6c Жыл бұрын
yes @@sumedhramteke9439
@yogalakshmik7232
@yogalakshmik7232 Жыл бұрын
sir can you please share the utility code ?
@agricultureinsights
@agricultureinsights Жыл бұрын
package api.utilities; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.DataFormatter; import org.apache.poi.ss.usermodel.FillPatternType; import org.apache.poi.ss.usermodel.IndexedColors; import org.apache.poi.xssf.usermodel.XSSFCell; import org.apache.poi.xssf.usermodel.XSSFRow; import org.apache.poi.xssf.usermodel.XSSFSheet; import org.apache.poi.xssf.usermodel.XSSFWorkbook; public class XUtility { public FileInputStream fi; public FileOutputStream fo; public XSSFWorkbook workbook; public XSSFSheet sheet; public XSSFRow row; public XSSFCell cell; public CellStyle style; String path; public XUtility(String path) { this.path=path; } public int getRowCount(String sheetName)throws IOException { fi = new FileInputStream(path); workbook=new XSSFWorkbook(fi); sheet=workbook.getSheet(sheetName); int rowcount=sheet.getLastRowNum(); workbook.close(); fi.close(); return rowcount; } public int getCellCount(String sheetName,int rownum)throws IOException { fi=new FileInputStream(path); workbook =new XSSFWorkbook(fi); sheet=workbook.getSheet(sheetName); row=sheet.getRow(rownum); int cellcount=row.getLastCellNum(); workbook.close(); return cellcount; } public String getCellData(String sheetName, int rownum, int colnum)throws IOException { fi =new FileInputStream(path); workbook=new XSSFWorkbook(fi); sheet=workbook.getSheet(sheetName); row=sheet.getRow(rownum); cell=row.getCell(colnum); DataFormatter formatter =new DataFormatter(); String data; try { data=formatter.formatCellValue(cell); } catch(Exception e) { data=""; } workbook.close(); fi.close(); return data; } public void setCellData(String sheetName, int rownum, int colnum, String data) throws IOException { File xlfile=new File(path); if(!xlfile.exists()) // If file not exists then create new file { workbook=new XSSFWorkbook(); fo=new FileOutputStream(path); workbook.write(fo); } fi=new FileInputStream(path); workbook=new XSSFWorkbook (fi); if(workbook.getSheetIndex (sheetName)==-1) // If sheet not exists then create new Sheet workbook.createSheet (sheetName); sheet-workbook.getSheet (sheetName); workbook.createSheet(sheetName); sheet=workbook.getSheet(sheetName); if(sheet.getRow(rownum)==null) // If row not exists then create new Row sheet.createRow(rownum); row-sheet.getRow(rownum); sheet.createRow(rownum); row=sheet.getRow(rownum); cell=row.createCell(colnum); cell.setCellValue(data); fo=new FileOutputStream(path); workbook.write(fo); fi.close(); fo.close(); } public void fillGreenColor(String sheetName,int rownum, int colnum)throws IOException{ fi=new FileInputStream(path); workbook=new XSSFWorkbook(fi); sheet=workbook.getSheet(sheetName); row=sheet.getRow(rownum); cell=row.getCell(colnum); style=workbook.createCellStyle(); style.setFillForegroundColor(IndexedColors.GREEN.getIndex()); style.setFillPattern(FillPatternType.SOLID_FOREGROUND); cell.setCellStyle(style); workbook.write(fo); workbook.close(); fi.close(); fo.close(); } public void FillRedColor(String sheetName, int rownum, int colnum) throws IOException { fi= new FileInputStream(path); workbook = new XSSFWorkbook(fi); sheet=workbook.getSheet(sheetName); row=sheet.getRow(rownum); cell=row.getCell(colnum); style=workbook.createCellStyle(); style.setFillForegroundColor(IndexedColors.RED.getIndex()); style.setFillPattern(FillPatternType.SOLID_FOREGROUND); cell.setCellStyle(style); workbook.write(fo); workbook.close(); fi.close(); fo.close(); } }
@epicgamers1998
@epicgamers1998 Ай бұрын
Please crete graphql automation using restassured
@sj-qj1zf
@sj-qj1zf Жыл бұрын
On Udemy how to get 'selenium with java course by Pavan sir' at offer price
@somashekarkv4845
@somashekarkv4845 Жыл бұрын
Every now and then after discount, price reduces to 449 Rs. Buy at that time.
@sj-qj1zf
@sj-qj1zf Жыл бұрын
@@somashekarkv4845 now the price is 3499/-
@somashekarkv4845
@somashekarkv4845 Жыл бұрын
@@sj-qj1zf Keep checking daily, it will reduce to 449 rs within this month
@lavanbalaraman
@lavanbalaraman 5 ай бұрын
can someone pls tell me how to get this xlutility file and dataprovider.java file.. i have watched part1 and now in part 2, but how to get the files i dono
@Lets_Roam
@Lets_Roam 5 ай бұрын
package api.utilities; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.DataFormatter; import org.apache.poi.xssf.usermodel.XSSFCell; import org.apache.poi.xssf.usermodel.XSSFRow; import org.apache.poi.xssf.usermodel.XSSFSheet; import org.apache.poi.xssf.usermodel.XSSFWorkbook; public class XLUtility { public FileInputStream fi; public FileOutputStream fo; public XSSFWorkbook workbook; public XSSFSheet sheet; public XSSFRow row; public XSSFCell cell; public CellStyle style; String path; public XLUtility(String path) { this.path=path; } public int getRowCount(String sheetName) throws IOException { fi=new FileInputStream(path); workbook=new XSSFWorkbook(fi); sheet=workbook.getSheet(sheetName); int rowcount=sheet.getLastRowNum(); workbook.close(); fi.close(); return rowcount; } public int getCellCount(String sheetName,int rownum) throws IOException { fi=new FileInputStream(path); workbook=new XSSFWorkbook(fi); sheet=workbook.getSheet(sheetName); row=sheet.getRow(rownum); int cellcount=row.getLastCellNum(); workbook.close(); fi.close(); return cellcount; } public String getCellData(String sheetName,int rownum,int colnum) throws IOException { fi=new FileInputStream(path); workbook=new XSSFWorkbook(fi); sheet=workbook.getSheet(sheetName); row=sheet.getRow(rownum); cell=row.getCell(colnum); DataFormatter formatter = new DataFormatter(); String data; try { data=formatter.formatCellValue(cell); } catch(Exception e) { data=""; } workbook.close(); fi.close(); return data; } public void setCellData(String sheetName,int rownum,int colnum,String data) throws IOException { File xlfile=new File(path); if(!xlfile.exists()) { workbook=new XSSFWorkbook(); fo=new FileOutputStream(path); workbook.write(fo); } fi=new FileInputStream(path); workbook=new XSSFWorkbook(fi); if(workbook.getSheetIndex(sheetName)==-1) workbook.createSheet(sheetName); sheet=workbook.getSheet(sheetName); if(sheet.getRow(rownum)==null) sheet.createRow(rownum); row=sheet.getRow(rownum); cell=row.createCell(colnum); cell.setCellValue(data); fo=new FileOutputStream(path); workbook.write(fo); workbook.close(); fi.close(); fo.close(); } }
@Lets_Roam
@Lets_Roam 5 ай бұрын
package api.utilities; import java.io.IOException; import org.testng.annotations.DataProvider; public class DataProviders { @DataProvider(name="Data") public String[][] getAllData() throws IOException { String path=System.getProperty("user.dir")+"//testData//UserData.xlsx"; XLUtility xl=new XLUtility(path); int rownum=xl.getRowCount("Sheet1"); int colcount=xl.getCellCount("Sheet1",1); String apidata[][]=new String[rownum][colcount]; for(int i=1;i
@user-su9hd7xr6v
@user-su9hd7xr6v 3 ай бұрын
Dear pavan Could you Share with us the Data provider file please
@user-he5vc2vu5v
@user-he5vc2vu5v 11 ай бұрын
can you share XLUtility file with me
@isuruakalanka8951
@isuruakalanka8951 Жыл бұрын
Can we get Utility files sir?
@sumedhramteke9439
@sumedhramteke9439 Жыл бұрын
package api.utilities; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import org.apache.poi.ss.usermodel.CellStyle; import org.apache.poi.ss.usermodel.DataFormatter; import org.apache.poi.ss.usermodel.FillPatternType; import org.apache.poi.ss.usermodel.IndexedColors; import org.apache.poi.xssf.usermodel.XSSFCell; import org.apache.poi.xssf.usermodel.XSSFRow; import org.apache.poi.xssf.usermodel.XSSFSheet; import org.apache.poi.xssf.usermodel.XSSFWorkbook; public class XLUtility { public FileInputStream fi; public FileOutputStream fo; public XSSFWorkbook workbook; public XSSFSheet sheet; public XSSFRow row; public XSSFCell cell; public CellStyle style; String path; public XLUtility(String path) { this.path = path; } public int getRowCount(String sheetName) throws IOException { fi = new FileInputStream(path); workbook = new XSSFWorkbook(fi); sheet = workbook.getSheet(sheetName); int rowcount = sheet.getLastRowNum(); workbook.close(); fi.close(); return rowcount; } public int getCellCount(String sheetName, int rownum) throws IOException { fi = new FileInputStream(path); sheet = workbook.getSheet(sheetName); row = sheet.getRow(rownum); int cellcount = row.getLastCellNum(); workbook.close(); fi.close(); return cellcount; } public String getCellData(String sheetName, int rownum, int colnum) throws IOException { fi = new FileInputStream(path); workbook = new XSSFWorkbook(fi); sheet = workbook.getSheet(sheetName); row = sheet.getRow(rownum); cell = row.getCell(colnum); DataFormatter formatter = new DataFormatter(); String data; try { data = formatter.formatCellValue(cell); } catch (Exception e) { data = ""; } workbook.close(); fi.close(); return data; } public void setCellData(String sheetName, int rownum, int colnum, String data) throws IOException { File xlfile = new File(path); if (!xlfile.exists())// if file not exist create new file { workbook = new XSSFWorkbook(); fo = new FileOutputStream(path); workbook.write(fo); } fi = new FileInputStream(path); workbook = new XSSFWorkbook(fi); if (workbook.getSheetIndex(sheetName) == -1) // if sheet not exist create new sheet workbook.createSheet(sheetName); sheet = workbook.getSheet(sheetName); if (sheet.getRow(rownum) == null) // if row not exist create new row sheet.createRow(rownum); row = sheet.getRow(rownum); cell = row.createCell(colnum); cell.setCellValue(data); fo = new FileOutputStream(path); workbook.write(fo); fi.close(); fo.close(); } public void fillGreencolor(String sheetName, int rownum, int colnum) throws IOException { fi = new FileInputStream(path); workbook = new XSSFWorkbook(fi); sheet = workbook.getSheet(sheetName); row = sheet.getRow(rownum); cell = row.getCell(colnum); style = workbook.createCellStyle(); style.setFillForegroundColor(IndexedColors.GREEN.getIndex()); style.setFillPattern(FillPatternType.SOLID_FOREGROUND); cell.setCellStyle(style); workbook.write(fo); workbook.close(); fi.close(); fo.close(); } public void fillRedcolor(String sheetName, int rownum, int colnum) throws IOException { fi = new FileInputStream(path); workbook = new XSSFWorkbook(fi); sheet = workbook.getSheet(sheetName); row = sheet.getRow(rownum); cell = row.getCell(colnum); style = workbook.createCellStyle(); style.setFillForegroundColor(IndexedColors.RED.getIndex()); style.setFillPattern(FillPatternType.SOLID_FOREGROUND); cell.setCellStyle(style); workbook.write(fo); workbook.close(); fi.close(); fo.close(); } }
@ojaswikumar9629
@ojaswikumar9629 4 ай бұрын
Why don't you provide any file
@nitheeshm4810
@nitheeshm4810 Жыл бұрын
Utility file link?
@Therealist16
@Therealist16 Жыл бұрын
Did you get the utility file link?
@vigneswarans5565
@vigneswarans5565 9 күн бұрын
1:11:45
@abhilashnagdeve9762
@abhilashnagdeve9762 2 ай бұрын
Sir pls provide Log4j2 xml file
@sarikagoel9528
@sarikagoel9528 2 ай бұрын
log4j2 file
@AbhishekGupta-1807
@AbhishekGupta-1807 7 ай бұрын
while running the file user i am facing the issue [RemoteTestNG] detected TestNG version 7.4.0 FAILED: f javax.net.ssl.SSLHandshakeException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:131) can anyone help me for this
@tomidor4779
@tomidor4779 6 ай бұрын
./logs
@FunLife-je8qo
@FunLife-je8qo 6 ай бұрын
sir plz, it is any issue firstname and last name not generated (not showing in output)other id,email,phone number and password generated(showing)
لااا! هذه البرتقالة مزعجة جدًا #قصير
00:15
One More Arabic
Рет қаралды 20 МЛН
Jumping off balcony pulls her tooth! 🫣🦷
01:00
Justin Flom
Рет қаралды 28 МЛН
Secret Experiment Toothpaste Pt.4 😱 #shorts
00:35
Mr DegrEE
Рет қаралды 38 МЛН
SDET | QA Automation Mock Interview - 5+ Years of Experience
1:55:33
Naveen AutomationLabs
Рет қаралды 215 М.
SDET Automation Mock Interview - 8+ YOE (Selenium, Java, API, Testing)
1:37:32
Naveen AutomationLabs
Рет қаралды 262 М.
لااا! هذه البرتقالة مزعجة جدًا #قصير
00:15
One More Arabic
Рет қаралды 20 МЛН