Skip to main content

Posts

Use of for Loop & return in Cypress Automation

  Use of  For Loop & return method in Cypress automation : describe(" Use Of For Loop and return method ",function(){   it ( 'Test Case 15' ,  function () { cy . visit ( 'www.exapmle.com/',{timeout:1000} );        cy . get ( '.tab-tools > .icon > .svg-inline--fa' ). click ({ force : true }); // Now this method will fetch the text which is already displayed & will save it.      cy . get ( '.last-updated-date > span' ). then (( $txt )  =>  {  const   txt  =  $txt . text ()      cy . log ( txt )                  // For loop will run 50 times & after each 3 seconds // it will check Visibility of element. // If it gets newly appeared element/Text It will be terminated before 50 runs var   i ;          for  ( i  =  0 ;  i  <  50 ;  i ++) {              cy . wait ( 3000 )                           cy . get ( '.last-updated-date > span' ). each (( $text )  =>  {   c

How to select a random option from dropdown in cypress ?

  Suppose that you have the following values in dropdown.   Step (1) Define all these values which are in your dropdown in an array for example. 👇   var   Reference  = [ "LinkedIn" ,  "Facebook" ,  "Twitter" ,  "Other" ,  "Instagram" ,  "Email" ,  "Friends" ]; Step (2) Then define a random function for example👇 var   randreferences  =  Reference [ Math . floor ( Math . random () *  Reference . length )]; Step (3) Call this random function in Select() method. for example 👇 cy . get ( '#aboutUs' ). select ( randreferences ) Important Note:This code should be in same test case where you are trying to do this one Enjoy✌ Full Code ==>👇👇👇 var   Reference  = [ "LinkedIn" ,  "Facebook" ,  "Twitter" ,  "Other" ,  "Instagram" ,  "Email" ,  "Friends" ]; var   randreferences  =  Reference [ Math . floor ( Math . random () *  Reference . lengt

How to upload users data from csv file in Jmeter ?

 Step (1) Create a .csv file. Step (2) Open Jmeter & create a New Test Plan . Add a Thread Group . Step (3) Right Click on Thread Group > Add > Config Element > CSV Data Config . Add  CSV Data Config file. Step (4)   Browse .CSV file.  Enter the Variable Names in the field 

Best alternatives of Whatsapp

 There is a famous quote " When a product have no price then you are the Product ". Whatsapp is going to apply new user policies for its users. Users have a lot of concerns about this new policy. Actually, Whatsapp wants legal permissions from its all users to share data with its clients. Users are very afraid about. Now, question is that what are the alternatives of  Whatsapp? are these providing same features as Whatsapp? 1) Telegram :- Telegram is a freeware, cross-platform, cloud-based instant messaging, video calling, and VoIP service. It was initially launched for iOS on 14 August 2013 and Android in October 2013. The app servers of Telegram are distributed worldwide to decrease data load, while operational center is currently based in Dubai. Pure instant messaging — simple, fast, secure, and synced across all your devices. Over 400 million active users. FAST: Telegram is the fastest messaging app on the market, connecting people via a unique, distributed network of

The terminal process "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" terminated with exit code: 259.

Integrated terminal in VS code crashes PowerShell: Solution of this Problem:- 1) Open your Project's/file location. 2)Click in this bar after opening the exact location of your project.                                                                                                                                         3)Now, Write 'cmd' in this bar.                                                                                                                     4)Your Terminal will be open as command, Now you can give any command here related to your Project. 5) Your project will be Executed/Start Normally in Terminal                                                                            6) You can ask any question.

Terminal is not working in VS code 1.18, it crashes PowerShell :259

Terminal is not opening in Visual Studio Code :  It is all due to a Virus .Which is running in background Applications. Open your Task Manager & End all the Tasks which are running in background. Install an Antivirus  and Scan your system. I will recommend you  Avira Antivirus. All virus files will be detected automatically. Give Permissions to Avira for removal of virus effected files. Now , Open your terminal it will work 100 %. I have personally got this issue & were not able to find any solution on  Stackoverflow  or any other platform.

How to interact with CkEditor(V4) in Cypress?

Interaction with CkEitor (V4) in Cypress:  CkEditor is a Third Party tool which is commonly used in websites. Open your ` commands.js ` file. Paste this code in it. Cypress . Commands . add ( 'iframe' , {  prevSubject :   'element'  }, ( $iframe )  =>  {      const   $iframeDoc  =  $iframe . contents ()      const   findBody  = ()  =>   $iframeDoc . find ( 'body' )      if  ( $iframeDoc . prop ( 'readyState' ) ===  'complete' )  return   findBody ()      return   Cypress . Promise (( resolve )  =>   $iframe . on ( 'load' , ()  =>   resolve ( findBody ()))) }); Cypress . Commands . add (      'iframeLoaded' , {  prevSubject :   'element'  },     ( $iframe )  =>  {          const   contentWindow  =  $iframe . prop ( 'contentWindow' )          return   new   Promise ( resolve   =>  {              if  (                  contentWindow  &&                  contentWindow . document . readyState