Selenium Certification Training-Anagha(July 13th- Aug 11)

Discussion in 'Web App and Programming' started by Anjana Singh, Jul 20, 2019.

  1. Anjana Singh

    Anjana Singh Member
    Simplilearn Support

    Joined:
    May 17, 2019
    Messages:
    12
    Likes Received:
    1
    Hi All,

    This is the dedicated thread for Selenium Certification led by Anagha. Here you can discuss anything regarding the course with your peers, TA and the trainer.

    Thanks and regards,
    Anjana
     
    #1
    Sailaja_12 likes this.
  2. Anagha Gadgil

    Anagha Gadgil Well-Known Member

    Joined:
    Mar 18, 2019
    Messages:
    149
    Likes Received:
    16
  3. Sagar_73

    Sagar_73 Member
    Alumni

    Joined:
    May 8, 2016
    Messages:
    2
    Likes Received:
    0
    Can you please upload the notes as well? Thank you.
     
    #3
  4. Anagha Gadgil

    Anagha Gadgil Well-Known Member

    Joined:
    Mar 18, 2019
    Messages:
    149
    Likes Received:
    16
    I have uploaded notes of day 3-4, all java code and also IDE tests [in document] on the google drive.
     
    #4
    SivaDeepthi likes this.
  5. SivaDeepthi

    SivaDeepthi Member

    Joined:
    Jun 26, 2019
    Messages:
    14
    Likes Received:
    0
    Hello Anagha...where can i fill the feedback?
     
    #5
  6. Anagha Gadgil

    Anagha Gadgil Well-Known Member

    Joined:
    Mar 18, 2019
    Messages:
    149
    Likes Received:
    16
    t
    You should have got the feedback link as soon as session was closed.
     
    #6
  7. Monesh Ali Sarkar

    Joined:
    Jul 9, 2019
    Messages:
    5
    Likes Received:
    0
    Hi Anagha....Please find the below code and the below issue that Im facing..........

    import java.util.Scanner;

    public class TestBanking {

    public static void main(String[] args) {

    Scanner scan;


    try {
    scan = new Scanner(System.in);
    HDFC_Bank hdfcbank = new HDFC_Bank();

    System.out.println("Please input initial Balance");
    hdfcbank.setBalance(scan.nextLong());
    System.out.println("balance is " + hdfcbank.getBalance());

    System.out.println("enter deposit");
    hdfcbank.deposit(scan.nextLong());

    System.out.println("check balance updated " + hdfcbank.getBalance());

    System.out.println("enter withdrawal amount");
    hdfcbank.withdrawal(scan.nextLong());

    System.out.println("check balance updated after withdrawal " + hdfcbank.getBalance());

    System.out.println("check interest amnt");
    System.out.println(Banking.calculateInterest(hdfcbank.getBalance()));

    System.out.println("enter overdraft amount balance");
    hdfcbank.setOverdraftBalance(scan.nextLong());

    System.out.println("overdraft balance is " + hdfcbank.getOverdraftBalance());

    System.out.println("borrow money from overdraft account");
    hdfcbank.Overdraft(scan.nextLong());

    System.out.println("overdraft balance is " + hdfcbank.getOverdraftBalance());
    scan.close();
    } catch (Exception e) {
    // TODO Auto-generated catch block

    e.printStackTrace();
    System.out.println(
    "please provide proper inputs without decimal or characters/strings or special characters");
    }
    }

    }



    I just wrote the above code for banking ....but I have a problem here with try/catch exceptions.

    whenever the user inputs something which is not an int or a long....then this exception is thrown and the code stops.
    I want the code not to stop but to ask the user again and again to put the proper input...and continue from the next line.

    For example...if the user inputs a wrong deposit....he should be prompted to re enter....and if he re enters correctly....then the next lines of code should continue executing.
    Can you pls help?
     
    #7
  8. SivaDeepthi

    SivaDeepthi Member

    Joined:
    Jun 26, 2019
    Messages:
    14
    Likes Received:
    0
    No..I have not been getting any emails asking for feedback
     
    #8
  9. SivaDeepthi

    SivaDeepthi Member

    Joined:
    Jun 26, 2019
    Messages:
    14
    Likes Received:
    0
    class D extends C, implements A, B
    Here C will be the super class of D right?
     
    #9
  10. Anagha Gadgil

    Anagha Gadgil Well-Known Member

    Joined:
    Mar 18, 2019
    Messages:
    149
    Likes Received:
    16
    yes
     
    #10
  11. Anagha Gadgil

    Anagha Gadgil Well-Known Member

    Joined:
    Mar 18, 2019
    Messages:
    149
    Likes Received:
    16

    Use it like this :



    import java.util.Scanner;



    public class Acceptinput {

    Scanner inputobj = new Scanner(System.in);



    public void acceptnumber() {

    int num1;



    while(true) {

    try {

    inputobj.nextLine(); /// you need this extra line .This will prompt you to just press enter key first time.

    System.out.println("Enter first number :");

    num1= inputobj.nextInt();

    System.out.println("Integer is : " + num1);

    break;

    } catch (Exception e)

    {

    System.out.println("Not an integer, Reenter");

    }



    }



    }



    public static void main(String[] args) {

    Acceptinput obj = new Acceptinput();

    obj.acceptnumber();



    }



    }
     
    #11
  12. Ankitha Suhas

    Ankitha Suhas Active Member

    Joined:
    Mar 26, 2019
    Messages:
    18
    Likes Received:
    2
    Assignment : Implement a subclass for HDFCBank which implements Banking and BankingBusiness interfaces.

    HDFCBank.java

    package com.java.simpli.day3;

    public class HDFCBank implements Banking, Bankbusiness, Transfer {

    @Override
    public void Overdraft() {
    System.out.println("You are in overdraft method of HDFC Bank");

    }

    @Override
    public float ROI() {
    System.out.println("Rate of interest calculation of HDFC bank");
    return 0;
    }

    @Override
    public void credit() {
    System.out.println("Credit method of HDFC Bank");

    }

    @Override
    public void debit() {
    // TODO Auto-generated method stub

    }

    @Override
    public void moneytransfer() {
    System.out.println("Transfer method of HDFC bank");

    }

    }

    TestBanking.java

    package com.java.simpli.day3;

    public class TestBanking {

    public static void main(String[] args) {
    Citibank c1 =new Citibank();
    c1.ROI();
    c1.credit();
    Banking.display();
    c1.Overdraft();
    HDFCBank h1=new HDFCBank();
    h1.Overdraft();
    h1.credit();
    h1.ROI();
    h1.moneytransfer();


    }

    }


    console:
    You are in ROI method of Citibank
    Credit method of Citibank
    This is banking interface
    You are in Overdraft method of Citibank
    You are in overdraft method of HDFC Bank
    Credit method of HDFC Bank
    Rate of interest calculation of HDFC bank
    Transfer method of HDFC bank
     
    #12
  13. Ankitha Suhas

    Ankitha Suhas Active Member

    Joined:
    Mar 26, 2019
    Messages:
    18
    Likes Received:
    2
    Hi Anagha,

    I tried the arraylist program using simple for loop.

    //traversing thru the array using simple for loop

    System.out.println("Displaying inside simple for loop");

    for(int i=0;i<3;i++) {
    System.out.println(languages);
    }


    console:
    Displaying inside simple for loop
    [C#, COBOL, Java, Python]
    [C#, COBOL, Java, Python]
    [C#, COBOL, Java, Python]

    It is just displaying the list 3 times.
    pls tell me how can I retrieve the elements using their index?
     
    #13
  14. SivaDeepthi

    SivaDeepthi Member

    Joined:
    Jun 26, 2019
    Messages:
    14
    Likes Received:
    0
    Hi Anagha,
    Whenever I try to record using IDE,Its getting stuck and I could not proceed doing anything on the browser.Please look the issue in below screenshot.

    upload_2019-7-24_13-59-21.png
     

    Attached Files:

    #14
  15. Anagha Gadgil

    Anagha Gadgil Well-Known Member

    Joined:
    Mar 18, 2019
    Messages:
    149
    Likes Received:
    16
    Please check if your Firefox is higher than 66 version
    Please remove all other extensions and check once
    Clear your cache and cookies also
     
    #15
  16. Ankitha Suhas

    Ankitha Suhas Active Member

    Joined:
    Mar 26, 2019
    Messages:
    18
    Likes Received:
    2
    Hi Anagha,

    I am getting error while using 'Play to this point' .while trying to play till typing iphones in the Amazon search usecase. Please explain why. err_playtothispoint.PNG
     

    Attached Files:

    #16
  17. Ankitha Suhas

    Ankitha Suhas Active Member

    Joined:
    Mar 26, 2019
    Messages:
    18
    Likes Received:
    2
    It is not working as expected.Instead of pausing at the step where I have given Play to this point, it is executing the complete case and then displaying this error.
     
    #17
  18. Anagha Gadgil

    Anagha Gadgil Well-Known Member

    Joined:
    Mar 18, 2019
    Messages:
    149
    Likes Received:
    16
    Please send me you project name.side file. I will take a look at it.
     
    #18
  19. Srikanth Ramachandran

    Joined:
    Mar 7, 2019
    Messages:
    4
    Likes Received:
    0
    Can you share the day5-6 notes google drive. when I goto the above google drive, I only get day3-4
     
    #19
  20. Harish Kumar_11

    Harish Kumar_11 New Member

    Joined:
    Feb 15, 2019
    Messages:
    1
    Likes Received:
    0
    Hi Anagha,
    Can you share the link of todays notes
     
    #20
  21. Diana Denis

    Diana Denis Member

    Joined:
    Apr 24, 2019
    Messages:
    4
    Likes Received:
    0
  22. Monesh Ali Sarkar

    Joined:
    Jul 9, 2019
    Messages:
    5
    Likes Received:
    0
    I couldnt find the google drive link for todays sessions notes and codes.
    Can someone please share the link here if you have it??
     
    #22
  23. SivaDeepthi

    SivaDeepthi Member

    Joined:
    Jun 26, 2019
    Messages:
    14
    Likes Received:
    0
  24. SivaDeepthi

    SivaDeepthi Member

    Joined:
    Jun 26, 2019
    Messages:
    14
    Likes Received:
    0
  25. Soumya_63

    Soumya_63 Active Member

    Joined:
    Jun 29, 2019
    Messages:
    16
    Likes Received:
    0
    upload_2019-7-28_23-3-23.png
    Mam m not getting TestNG output here and the Index html too.
     
    #25
  26. Anagha Gadgil

    Anagha Gadgil Well-Known Member

    Joined:
    Mar 18, 2019
    Messages:
    149
    Likes Received:
    16
    Notes and java code for Day 5&6 uploaded to the drive.
     
    #26
  27. Ankitha Suhas

    Ankitha Suhas Active Member

    Joined:
    Mar 26, 2019
    Messages:
    18
    Likes Received:
    2
    How should I send it?While trying to upload, it is showing as extension is not supported.
     
    #27
  28. Soumya_63

    Soumya_63 Active Member

    Joined:
    Jun 29, 2019
    Messages:
    16
    Likes Received:
    0
    Mam I am unable to find testNg output below drivers
     
    #28
  29. Rani Shigvan

    Rani Shigvan Member

    Joined:
    Jun 26, 2019
    Messages:
    3
    Likes Received:
    0
    Hi Anagha,
    I am trying to do coding for Project assignment "My store" application. After clicking create an account when i try to fill form details like first name, last name etc. my code is not executing also title is not mandatory but don' know why it is not directly start adding first name. I tried clicking Title radio button also but it is not working. Xpaths are working for First name, Last name, Title radio button. But dont know what is the issue. Due to which i am not able to fill form details and Register new account. Please have a look
    public void createAccount() {
    driver.get("http://automationpractice.com/index.php");
    driver.findElement(By.xpath("//a[@title='Log in to your customer account']")).click();
    driver.findElement(By.xpath("//input[@id ='email_create']")).sendKeys("my@rediffmail.com");
    driver.findElement(By.xpath("//button[@name='SubmitCreate']//span")).click();
    WebElement title2 = driver.findElement(By.id("id_gender2"));
    title2.click();
    driver.findElement(By.xpath("//input[@id='customer_firstname']")).sendKeys("Rani");
    /*driver.findElement(By.xpath("//input[@id='customer_lastname']")).sendKeys("Shigvan");
    driver.findElement(By.xpath("//input[@id='passwd']")).sendKeys("12345");
    driver.findElement(By.xpath("//input[@id='address1']")).sendKeys("abcd");
    driver.findElement(By.xpath("//input[@id='city']")).sendKeys("mumbai");
     
    #29
  30. Ankitha Suhas

    Ankitha Suhas Active Member

    Joined:
    Mar 26, 2019
    Messages:
    18
    Likes Received:
    2
    Hi Anagha,

    Facing some issues while doing parallel testing.I have installed chrome driver and still it is showing as failed. Parallel_test1.PNG Parallel_test2.PNG
     
    #30
  31. Anagha Gadgil

    Anagha Gadgil Well-Known Member

    Joined:
    Mar 18, 2019
    Messages:
    149
    Likes Received:
    16
    Zip the file and send
     
    #31
  32. Anagha Gadgil

    Anagha Gadgil Well-Known Member

    Joined:
    Mar 18, 2019
    Messages:
    149
    Likes Received:
    16
    Refresh the project.
    Open the project in system explorer and look for test-output folder. you should find it.
     
    #32
  33. Anagha Gadgil

    Anagha Gadgil Well-Known Member

    Joined:
    Mar 18, 2019
    Messages:
    149
    Likes Received:
    16
    Try to add chromedriver in the PATH variable.
    goto your environment variables, edit the PATH variable and add the path to chromedriver and see if this solves the problem
     
    #33
  34. Ankitha Suhas

    Ankitha Suhas Active Member

    Joined:
    Mar 26, 2019
    Messages:
    18
    Likes Received:
    2
    Hi Anagha,

    Kindly find the zipped file attached.
     

    Attached Files:

    #34
  35. Ankitha Suhas

    Ankitha Suhas Active Member

    Joined:
    Mar 26, 2019
    Messages:
    18
    Likes Received:
    2
    Hi Anagha,

    It is working fine after adding the path to chromedriver.I could do parallel testing and cross browser testing.

    Cheers:)
     
    #35
    Anagha Gadgil likes this.
  36. Rani Shigvan

    Rani Shigvan Member

    Joined:
    Jun 26, 2019
    Messages:
    3
    Likes Received:
    0
    Hi Anagha,
    Have u check the issue?
     
    #36
  37. Anagha Gadgil

    Anagha Gadgil Well-Known Member

    Joined:
    Mar 18, 2019
    Messages:
    149
    Likes Received:
    16
    I executed your side file . Here is the output. It executes tests from IDETestsuite and I see that AmazonSearch test case fails both in IDE as well as command prompt which is expected behaviour. Rest all passed. Here is the output

    t usage information

    Anaghas-MacBook-Air:Downloads anaghagadgil$ selenium-side-runner -f IDETestSuite MyProject2.side

    info: Running MyProject2.side

    PASS IDETestSuite/waitfortest.test.js (14.339s)

    PASS IDETestSuite/CalorieTest.test.js (16.573s)

    FAIL IDETestSuite/Amazonsearch.test.js (25.969s)

    ● Amazonsearch


    TimeoutError: Waiting for element to be located By(css selector, *[id="twotabsearchtextboxgh"])

    Wait timed out after 15049ms


    at ../../../../usr/local/lib/node_modules/selenium-side-runner/node_modules/selenium-webdriver/lib/webdriver.js:841:17


    Test Suites: 1 failed, 2 passed, 3 total

    Tests: 1 failed, 2 passed, 3 total

    Snapshots: 0 total

    Time: 26.815s, estimated 32s

    Ran all test suites.
     
    #37
  38. Anagha Gadgil

    Anagha Gadgil Well-Known Member

    Joined:
    Mar 18, 2019
    Messages:
    149
    Likes Received:
    16
    Also please note that fallback locator mechanism does not seem to work for Side runner. it works through IDE only
     
    #38
  39. Ankitha Suhas

    Ankitha Suhas Active Member

    Joined:
    Mar 26, 2019
    Messages:
    18
    Likes Received:
    2
    Hi Anagha,

    Now, it is working fine while running thru command prompt.But some options, like 'Play to this point' and 'Pause on exceptions' are not working in IDE.For Pause on exceptions even after I manipulate the element,it is still locating that element and continuing to execute the test.It is not pausing while trying to locate the element.
     
    #39
    Last edited: Jul 31, 2019
  40. Ankitha Suhas

    Ankitha Suhas Active Member

    Joined:
    Mar 26, 2019
    Messages:
    18
    Likes Received:
    2
    Assignment:Working on the dropdown month and year in FB page using select the class

    public void selectdropmonth() {
    driver.get("https://www.facebook.com/");
    WebElement month_ele=driver.findElement(By.id("month"));
    Select month_select=new Select(month_ele);

    month_select.selectByValue("3");
    month_select.selectByIndex(7);
    month_select.selectByVisibleText("Jun");
    }
    public void selectdropyear() {
    driver.get("https://www.facebook.com/");
    WebElement year_ele=driver.findElement(By.id("year"));
    Select year_select=new Select(year_ele);
    year_select.selectByValue("0");
    year_select.selectByIndex(12);
    year_select.selectByVisibleText("1999");
    }

    public static void main(String[] args) {

    Dropdown d1=new Dropdown();
    d1.launchBrowser();
    //d1.selectdrop();
    //d1.selectdropmonth();
    d1.selectdropyear();
     
    #40
    Anagha Gadgil likes this.
  41. Rani Shigvan

    Rani Shigvan Member

    Joined:
    Jun 26, 2019
    Messages:
    3
    Likes Received:
    0
    issue got resolved but capturing and showing error message topic i think we have not discussed yet.so are we covering this in next session?
     
    #41
  42. Anagha Gadgil

    Anagha Gadgil Well-Known Member

    Joined:
    Mar 18, 2019
    Messages:
    149
    Likes Received:
    16
    Play to this point like like adding a debugger. pausing while trying to locate the element depends on which point you are adding this.
    Pause on exeception is when an exception occurs, it stops at the line. you can correct it and run that from same point in debug mode or just run.
    Lets see in this week's session during the break.
     
    #42
  43. Soumya_63

    Soumya_63 Active Member

    Joined:
    Jun 29, 2019
    Messages:
    16
    Likes Received:
    0
    Hi Anagha,
    How and where the project shoyuld be submitted.
     
    #43
  44. Soumya_63

    Soumya_63 Active Member

    Joined:
    Jun 29, 2019
    Messages:
    16
    Likes Received:
    0
    And In project Non functional Area is that compulsory to execute???????
     
    #44
  45. Monesh Ali Sarkar

    Joined:
    Jul 9, 2019
    Messages:
    5
    Likes Received:
    0
    Hi Anagha,
    Below is the amazon homepage link that I was trying to locate in selenium but unable to find with any locators...I am getting NoSuchelement exception: 2019-07-31_LI (2).jpg
     
    #45
  46. Diana Denis

    Diana Denis Member

    Joined:
    Apr 24, 2019
    Messages:
    4
    Likes Received:
    0
    Please look if i am on a right path,i tried to do selenium record so far also i do not understand when did we do Directory? i looked in all recordings and have not seen it for that reason i do not have chrome.exe under my Drivers in eclipse? please help,thanks.
     

    Attached Files:

    #46
  47. Soumya_63

    Soumya_63 Active Member

    Joined:
    Jun 29, 2019
    Messages:
    16
    Likes Received:
    0
    Hi ,
    I am unable to execute dropdown program.
    Only when I do selectbyvisibletext it is getting executed, but selectbyindex and selectbyvalue is not getting executed.
     
    #47
  48. Anagha Gadgil

    Anagha Gadgil Well-Known Member

    Joined:
    Mar 18, 2019
    Messages:
    149
    Likes Received:
    16
    #48
  49. Anagha Gadgil

    Anagha Gadgil Well-Known Member

    Joined:
    Mar 18, 2019
    Messages:
    149
    Likes Received:
    16
    you have to
    Share your code and the error you are getting
     
    #49
  50. Anagha Gadgil

    Anagha Gadgil Well-Known Member

    Joined:
    Mar 18, 2019
    Messages:
    149
    Likes Received:
    16
    In the session where I started with first script of selenium, I asked everyone to create a dir called drivers under you project directory.
    And all both your driver files under this driver folder.
    This is required for Webdriver.

    What you have shared is the side file which is created using Selenium IDE recorder. So what are you trying to do with this file?
    Please elaborate on the question you have
     
    #50

Share This Page