Posts

Showing posts from November, 2022

For Get Dynamic data & USe it into Postman Body parameters

Need to Add script in Pre-request script tab   1. Registration call window  =  {}; pm . sendRequest ( "https://cdnjs.cloudflare.com/ajax/libs/Faker/3.1.0/faker.min.js" , ( error ,  response )  =>  { var   text   =   response . text (); ( new   Function ( text ))(); window. faker . locale   =   "en_IND" ; var   email   =  window. faker . internet . email () console . log ( email ) pm . collectionVariables . set ( "User_Email" ,  email );  var   Password   =  window. faker . internet . password () console . log ( Password ) pm . collectionVariables . set ( "User_Password" ,  Password );  })           2. Insert Person window  =  {}; pm . sendRequest ( "https://cdnjs.cloudflare.com/ajax/libs/Faker/3.1.0/faker.min.js" , ( error ,  response )  =>  {      var   text   =   response...

Login through Data Driven Testing in selenium

UserLogin .java package UserStory; import org.openqa.selenium.By; import org.testng.annotations.BeforeTest; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import com.aventstack.extentreports.ExtentReports; import BasePackage.Startup; import UserStory_webelements.UserLoginwbElements; import Utility.ExcelFileReader; import io.github.bonigarcia.wdm.WebDriverManager; public class UserLogin extends Startup implements UserLoginwbElements { public static ExtentReports report; public static ExcelFileReader data1 = new ExcelFileReader( "C:\\Users\\TechExtensor 21\\Downloads\\DisBox\\src\\main\\resources\\Excelsheet\\MemberLogin.xlsx"); @BeforeTest public void openDriver() throws InterruptedException { WebDriverManager.chromedriver().setup(); setBrowsers("Chrome"); driver.manage().window().maximize(); report = new ExtentReports(); Launchchannel(); Thread.sleep(7000); } @Test(dataProvider = "getdataXls...

How does Selenium Webdriver handle SSL certificate in Chrome?

  For the Chrome browser, one can handle the  SSL certificates  using  ChromeOptions  class provided by  Selenium WebDriver . It is a class that we can use to  set properties for the Chrome browser . Let us now see what additions we will make to the existing code, and then we will understand the same import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.chrome.ChromeOptions; public class SSLHandling { public static void main (String[] args) { //Create instance of ChromeOptions Class ChromeOptions handlingSSL = new ChromeOptions (); //Using the accept insecure cert method with true as parameter to accept the untrusted certificate handlingSSL.setAcceptInsecureCerts( true ); //Creating instance of Chrome driver by passing reference of ChromeOptions object WebDriver driver = new ChromeDriver (handlingSSL); //Launching the URL driver.get( "ht...