ankit ramola's Profile
Vice Professor
650
Points

Questions
2

Answers
81

  • Vice Professor Asked on February 14, 2017 in Selenium WebDriver.

    Hi Ramya,

    You can try this code.

     

    WebDriver driver = new  FirefoxDriver();
    String parentHandle = driver.getWindowHandle();   //get parent window handle
    Set<String> windowHandles = driver.getWindowHandles();  // get all window handles
    for(String window : windowHandles){
    driver.switchTo().window(window);
    if(driver.getTitle().equals(“your title”)){   // iterate this set untill you find your window
    // perform operation
    }
    }
    driver.switchTo().window(parentHandle);
    }

     

    Regards,
    Ankit

    • 229 views
    • 1 answers
    • 0 votes
  • Vice Professor Asked on August 24, 2016 in Selenium WebDriver.

    Hi,

    If you will check the code in DesiredCapabilities class
    to initiliaze the class with new keyword
    You have to pass 3 argumets.

    public DesiredCapabilities(String browser, String version, Platform platform) {
    setCapability(BROWSER_NAME, browser);
    setCapability(VERSION, version);
    setCapability(PLATFORM, platform);
    }

    But when you initiliaze it with DesiredCapabilities.firefox(); // which is a static method of class

    it initiliaze the object with new keyword insie static method

    public static DesiredCapabilities firefox() {
    return new DesiredCapabilities(BrowserType.FIREFOX, “”, Platform.ANY);
    }

    • 468 views
    • 1 answers
    • 0 votes
  • Vice Professor Asked on July 13, 2016 in Selenium WebDriver.

    HI SD,

    you can directly try
    //div[@id=’all-grid’]/div

    Regards
    Ankit

    • 395 views
    • 1 answers
    • 0 votes
  • Vice Professor Asked on July 7, 2016 in Selenium WebDriver.

    Hi John,

    Html elements have attributes

    in belowe html snippet input is tag
    and all highligted are called as attributes
    <input  id=”from_typeahead1 class=”typeahead1 input-md form-control tt-input tabindex=”4 onkeypress=”javascript:checkSpecialCharacters(event); placeholder=”Type Departure City autocomplete=”off spellcheck=”false style=”position: relative; vertical-align: top; dir=”auto>

    you can use any attribues with tag name to create xpath
    like in your case you can create xpath as
    //input[@placeholder=’Type Departure City‘]
    other attributes can also be used to create xpath like
    //input[@dir=’auto‘]
    //input[@spellcheck=’false’].
    i hope your doubt is clear now.

    Regards
    Ankit

    • 439 views
    • 3 answers
    • 0 votes
  • Vice Professor Asked on July 6, 2016 in Selenium WebDriver.

    Hi Krist,

    On hovering tooltip there must be an element which is getting visible .So you need to verify if element is getting visible or not and to be more specific get the text of that element and Assert it.

    This answer accepted by Kristof. on July 6, 2016 Earned 15 points.

    • 673 views
    • 1 answers
    • 0 votes
  • Vice Professor Asked on June 27, 2016 in Selenium WebDriver.

    HI,

    selenium-server-standalone-2.53.0
    selenium-htmlunit-driver-2.52.0
    selenium-java-2.53.0

    can you please try again  by downgrading your version to 2.52.0
    let me know if it works

    thanks

    • 787 views
    • 1 answers
    • 0 votes
  • Vice Professor Asked on June 8, 2016 in Selenium WebDriver.

    Hi shaifali,

    you can override on Exception method in the below link to check if the exception is caused by this error page on not

    you can override method something like that

    public void onException(Throwable arg0, WebDriver arg1) {
    // TODO Auto-generated method stub
    check the presence of error page in this
    System.out.println(“Exception occured at “ + arg0.

    http://toolsqa.com/selenium-webdriver/event-listener/

    • 561 views
    • 2 answers
    • 0 votes
  • Vice Professor Asked on February 25, 2016 in Selenium WebDriver.

    Hi Atchuta,

    Simply put a null check
    Row  = ExcelWSheet.getRow(RowNum);

    if(Row ==  null){
    Row =ExcelWsheet.createnewRow(Rownum);
    }

    • 652 views
    • 2 answers
    • 0 votes
  • Vice Professor Asked on January 27, 2016 in Selenium WebDriver.

    Hi,

    You need to override onTestFailure method of ITestListener(Testng)
    and call your screenshotmethod in this method.

    • 1446 views
    • 1 answers
    • 0 votes
  • Vice Professor Asked on January 20, 2016 in Selenium WebDriver.

    Hi Neha

    @BeforeSuite Annotation In TestNG-
    This is like a common method you wanted to run before your test suite
    this will run once only in a suite
    ex: may be you wanted to create a database connection before your test suite and wanted to use it throughout your test case run

    OnStart Method in ISuiteListener
    Generally listeners are used for logging purpose
    so if you will define onstart method in your class. the method will be called for every method that will run in your test suite.
    like in this case

    public void onStart(ISuite arg0) {
    Reporter.log(“About to begin executing Suite “ + arg0.getName(), true);
    } // the method will log same when any method will run About to begin executing Suite + method name

    so that it will be easier for you to log

    • 980 views
    • 1 answers
    • 1 votes
  • Vice Professor Asked on January 15, 2016 in Selenium WebDriver.

    Selenium with php means the selenium code you will write will be in php,
    Selenium is same for all those languages but the way of implementing things will change because of change in technology.
    as you have worked in java you wont be facing much trouble implementing selenium with php..

    • 525 views
    • 2 answers
    • 0 votes
  • Vice Professor Asked on August 8, 2015 in Selenium WebDriver.

    hi jasmeet

    just go through this link and if u still need some clarifaction let me  know

    http://www.toolsqa.com/selenium-webdriver/wait-commands/

    • 693 views
    • 1 answers
    • 0 votes
  • Vice Professor Asked on August 3, 2015 in Selenium WebDriver.

    Hi rava.
    I googled a lilltle about this problem and. Concluded
    1) you can try manually performing the action on the element and see if that works..??

    2) make sure that xpath u are using belong to a single web element by using firepath

    • 1367 views
    • 4 answers
    • 0 votes
  • Vice Professor Asked on April 22, 2015 in Selenium WebDriver.

    Hi Laxmi

    i guess you should go with Testng.xml as you can define your test cases there, there order,there groups  although i have no idea about  TestNG>Convert to TestNG  but i guess using testng.xml to control your test cases is better

    and you can define testng.xml in your pom this way

    
    
    		
    
    
    
    • 954 views
    • 3 answers
    • 0 votes
  • Vice Professor Asked on December 19, 2014 in Software Testing.

    Hi Abi

    Unfortunately it should nt be But it does
    You can have Advantage for being a Certified Tester, in case When Company have to Choose between certified and non certified guy
    and a few of companies wont consider you without certification

    • 548 views
    • 3 answers
    • 0 votes
  • Vice Professor Asked on December 16, 2014 in Software Testing.

    this is not a manual testing blog so please stop posting those queries here

    • 621 views
    • 2 answers
    • 0 votes
  • Vice Professor Asked on December 13, 2014 in Selenium WebDriver.

    Hi Sambha

    File pathToBinary=new File("FIREFOX_PATH ");

    U must be Concened  about this line  Suppose you have Firefox 32 in your System and you Wanted to Run your test against firefox 22
    so in that Case  u can get binaries for firefox 22 and run ur test case against firefox 22

    FirefoxProfile ffProfile=new FirefoxProfile();

    Suppose

    you Want to Use FireFox With some changed Settings in That Case u Can give the name of Profile Created by you With your Settings

    WebDriver driver=new FirefoxDriver();
    and in this Case it will launch your default Firefox say
    if u have 32 with default firefox profile

    anything else u wanna knw..?

    This answer accepted by samba. on December 15, 2014 Earned 15 points.

    • 433 views
    • 1 answers
    • 0 votes
  • Vice Professor Asked on November 27, 2014 in Selenium WebDriver.

    Hi
    I Guess This is The problem
    you are initializing your Webdriver in @beforeClass they got initialized before Class
    But When Class Code is Running It is Setting There Values to Null

    You Just Try Doing Same Thing With @before

    i Hope It will work

    Regards
    Ankit Ramola

    • 628 views
    • 2 answers
    • 0 votes
  • Vice Professor Asked on November 27, 2014 in Selenium WebDriver.

    Hi Nisha
    //area[@coords=’143,152,184,162,180,193,164,191,134,172,144,152‘]     Did you tried it using Xpath..?

    • 610 views
    • 1 answers
    • 0 votes
  • Vice Professor Asked on November 26, 2014 in Selenium WebDriver.

    Hi Rahul
    I dont Think That Selenium Has Anything to do With Technology Every Website Have Html and Selenium Works on That  Html
    You Can Keep a Seprate .xml File For your Test Cases

    • 296 views
    • 1 answers
    • 0 votes
  • Vice Professor Asked on November 25, 2014 in Selenium WebDriver.

    Hi Shubha

    Stale Element Exception can be Avoided by putting Proper wait After the Line That is Causing Javascript Action
    Make Sure that Complete Javascript have been Performed Before You TryIng Action on some Element

    Regards
    Ankit

    • 1311 views
    • 3 answers
    • 0 votes
  • Vice Professor Asked on November 24, 2014 in Selenium WebDriver.

    Hi
    You Just Compare there Xpath They Must be Differing with Some Index
    movie1: .//*[@id=’ProductForm_37′]/div[8]/input    // index=8

    movie2 .//*[@id=’ProductForm_90′]/div[6]/input    // index 6
    Something Like This

    • 548 views
    • 3 answers
    • 1 votes
  • Vice Professor Asked on November 21, 2014 in Selenium WebDriver.

    Hi Asha
    Exception in thread “main” org.openqa.selenium.StaleElementReferenceException: Element not found in the cache  // This Exception comes when
    Xpath oF Elment has been changed
    Webdriver has already Find That Element  in Page But Because of Page Refresh The Xpath of Element has been Changed

    • 2022 views
    • 3 answers
    • 0 votes
  • Vice Professor Asked on November 21, 2014 in Selenium WebDriver.

    Hi
    Create a Folder in Your Project and Put Your Excel File In that Folder
    and Give File Path Like  File Excel=new File(“./foldername/filename”);

    • 2592 views
    • 1 answers
    • 0 votes
  • Vice Professor Asked on November 21, 2014 in Selenium WebDriver.

    Hi

    All Those Elements Must be Differing with Some Index so try Parametrizing The Method That is Getting Text
    Something like That
    for(some values of i)
    {
    String sText = uiItem.findElement(By.xpath(“//*[@id=’shoe_list’]/li[“+i+”]/div/table/tbody/tr[4]/td[“”+i+”]”)).getText(); // suppose this is the index that is differing

    if(sText.equals(“text u need”)){
    return sText;
    }else{
    i++
    }
    }

    Something like that Should Work i guess…if it Dont Please Post More Info about your problem

    Regards
    Ankit

    • 475 views
    • 1 answers
    • 0 votes