Posts

Showing posts with the label java

How to authenticate alert popup using Selenium

Image
  Solution : Use the following code. Example is given in using Firefox. String url = "https://dev20.***********.com/************"; String username = "s*****"; String password = "e******"; System.setProperty("webdriver.gecko.driver", "Geckodriver\\v0.21.0-win64\\geckodriver.exe"); WebDriver   driver = new FirefoxDriver(); String urlTemp = url.replaceFirst("https://", ""); String URL = "https://" + username  + ":" + password + "@" + urlTemp; driver.get(URL); ............................................................................................................... My failed attempt  #01: The following code didn't for me & provide Error:    "org.openqa.selenium.UnsupportedCommandException: POST /session/ef0fb2c1-e4c1-4d63-bab7-6a8fbe03af8b/alert/credentials did not match a known command" String url = "https://dev20.***********.com/************"; Stri...

How to secure java code [jar file]

 I have been searching an easy way to encrypt my code to ensure my java code security. I have found an easy solution (free solution), May be you might like it :  I'm useing jCrypt.jar for this here. Go download the file.     source : https://github.com/wille/jcrypt/releases How to use jCrypt.jar to encrypt jar file ?  Step 01 : Make sure you have jCrypt.jar & Bin.jar in the same directory.  Step 02: Double click jCrypt.jar file. Step 03: Click Browser button & select the jar file you want to encrypt.  & click next  Step 05 : Select your Mail file if not automatically selected the right one.  & click next  Step 06 : Select "Encrypt classes (Resources will be in .jar)" option & click next  Step 06 : Select the location along with file name where you want to write you file.  & click next  Done :) close the jCrypt.