Skip to main content

Posts

Showing posts from July, 2020

Sonar Qube Quickstart

Software Characterstics 1. Specific Conventions followed or not 2. Good Practices are being followed and bad practices have been avoided. 3. Are there any potential bugs and performance issues and security vulnerabilities 4. Is there any duplicate code. 5. public API has good information or not 6. unit tests 7.good design and architecture principles Static Code Analysis: 1. It is similar to compiler warnings 2. Static code analysis is like a white box testing looks at appliacations in non-runtime environments. 3. It is considered as a way to automate the code review process. 4. Detecting errors in programs 5. Recommending code formatiing if the source code follows the code formatting accepted in your company. Static Code Analysis Tools:- 1. FindBugs :- It is better than PMD and CheckStyle It helps in detecting the potential bugs and performance issues. 2. PMD:- Main focus --> Bad practices 3. Checkstyle  --> Main focus --> Conventions 4. HP Fortify:- Main focus --> secu...

Xpath toughest

1. //span[contains(text(),'Please enter the comments!')]//following-sibling::div//input//following-sibling::textarea Some of the other Xpaths are 1. search RBGA //clicking on the new request //a[@title='Request a new workflow for RB General Approval Form']         @FindBy(xpath="//body[contains(@class,'ext-safari')]/form[contains(@name,'workOnIssueForm')]/table[contains(@class,'jiraform maxWidth')]/tbody/tr/td[contains(@class,'rb_formArea')]/fieldset[contains(@class,'rb_WorkON_FieldSet')]/table/tbody/tr/td/div[contains(@class,'rb_WorkON_FieldContainer')]/div[contains(@class,'rb_WorkON_FieldValueArea rb_WorkON_FieldValueArea_create rb_WorkON_ValueArea_Wide')]/table[contains(@class,'workonstdtable')]/tbody/tr/td/input[1]")     public WebElement tickMark;         @FindBy(xpath="//body[contains(@class,'ext-safari')]/form[contains(@name,'workOnIssueForm')]/table[contains(@class,...

Date Time API

Issues with the Existing   Date / Time   APIs 1. Thread Safefty:- develpoers have to deal with concurrency issues.new date and time api in java 8 are immutable and thread safe and thus taking concurrency headache away from developers. 2. API Design and Ease of Understanding: good utility methods in new API 3. Zoned Date and Time Functinality is added. 4. The format that I have used in my project is basically a user defined format String userdefinedDate=localdate.format(DateTimeFormatter.ofPattern("dd.MM.yyyy")); System.out.println(userdefinedDate); ==================================================================== Study Link https://www.baeldung.com/java-8-date-time-intro#:~:text=Java%208%20provides%20ZonedDateTime%20when,to%20represent%20them%20as%20follows. Working With   LocalDate LocalDate localDate = LocalDate.now(); LocalDate.of(2015, 02, 20); LocalDate tomorrow = LocalDate.now().plusDays( 1 ); DayOfWeek sunday = LocalDate.parse("2016-06-12").getDayOfWeek...

log4j2 in java maven

1. Install the log4jcore maven dependency 2. Install the log4japi maven dependency 3. Then write the below code just make sure you are importing the the packages just check while you are importing import these two only I have imported other log and faced some problem thats why i am saying package com.sandy; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; public class App {     private static final Logger logger=LogManager.getLogger(App.class);     public static void main(String[] args) {                 System.out.println("hello world");         logger.trace("this is the trace message");         logger.debug("this is the debug message");         logger.info("this is the info message");            logger.warn("this is the debug mes...

Clean Code Sonar Lint Java

Coding Guidelines 1. Sections of code should not be commented out (java:S125) CODE_SMELLCode smellMAJORMajor Programmers should not comment out code as it bloats programs and reduces readability. Unused code should be deleted and can be retrieved from source control history if required. 2. Standard outputs should not be used directly to log anything (java:S106) CODE_SMELLCode smellMAJORMajor When logging a message there are several important requirements which must be fulfilled: • The user must be able to easily retrieve the logs • The format of all logged message must be uniform to allow the user to easily read the log • Logged data must actually be recorded • Sensitive data must only be logged securely If a program directly writes to the standard outputs, there is absolutely no way to comply with those requirements. That's why defining and using a dedicated logger is highly recommended. Noncompliant Code Example System.out.println("My Message");  // Noncompliant Complia...

Clear cache Selenium

    /*      * // clear cache      *      * public static void clearCache() throws InterruptedException {      *      * String chromedriverPath = System.getProperty("user.dir") +      * "\\src\\test\\resources\\executable\\chromedriver.exe";      *      * System.setProperty("webdriver.chrome.driver", chromedriverPath);      * ChromeOptions chromeoptions = new ChromeOptions();      *      *      * // chromeoptions.addArguments("--headless");      * chromeoptions.addArguments("start-maximized");      *      * chromeoptions.addArguments("disable-extensions");      *      * chromeoptions.addArguments("--disable-popup-blocking");   ...

How to Break a Search Box new

Always perform these SQL injection or any kind of testing in Test Environment Null (if you are testing an API) Zero Characters one character Two character some character One Less than the Maximum allowed The maximum allowed number of caracters one more than the maximum allowed number of characters Spaces in the text Symbols Punctuation ASII German,Japansese,Arabic Characters Unicode Characters Try SQL Injections Attach ‘ or 1=1;–. JavaScript Injection HTML injection

Clean Coding Practices

Uncle Bob Clean Code Methods 1. Above one is for first 30 mins next one will be for next 14 mins 2. 3. This is the link to the video https://www.youtube.com/watch?v=7EmboKQH8lM

Steps to Create TestCase AMLACTGLIBMAE

1. Go to SearchPage and goto function gotoAMLACTGLIBMAE there find the element new Request and clik on the new Request for the AMLACTBLIBMAE 2. com.wokon.pages.actions.amlactglibmae 3. Inside the above package create the class --> AMLACTGLIBMAERequestCreation.java 4. Create package --> com.workon.pages.locatos.amlactglibmae  5. Inside the above package create a class --> AMLACTGLIBMAERequestCreationLocators.java 6. Now to got src/test/java --> com.workon.testcases.generic 7. Create the testcase class ---> TestCase_AMLACTGLIBMAERERequestCreation.java 8. Now go to com.wokon.pages.actions.amlactglibmae.AMLACTGLIBMAERequestCreation.java create the constructor and initialize the locator class using the    --> AjaxElementLocatorFactory and PageFactory.initElements 9. Now find all the locators needed to create the request and store it in a sublime text file 10. Move all the locators to the locators file  11. Go to Testcase --> BeforeClass and AfterClass...

Selenium Automation using Selenoid

1. This is a link which I will be using to refer to Selenoid this can be used to run the testing online  https://medium.com/javarevisited/selenide-in-testing-process-automatisation-through-selenoid-in-the-docker-container-48e659d2ee72?source=email-4aa0d39d65dd-1594241674497-digest.reader------0-59------------------42882bf1_2696_4dae_a4fd_fb88fdf7e692-1-8b442eb7_e91f_40be_aa6b_f92b65769afd----