Lajish Lakshmanan's Profile
Train
23
Points

Questions
2

Answers
7

  • Train Asked on October 27, 2014 in Selenium WebDriver.

    Some how I have found a work around for selecting drop down control having div class which is usually observed in JQWidgets. We can 2 click events against those drop down controls for selecting any value

    • 5385 views
    • 5 answers
    • 0 votes
  • Train Asked on September 19, 2014 in Selenium WebDriver.

    Hi Lakshay,

    Please have look over same type of control. You will find same in that website which I already mentioned above.

    RE: How to select JQ Widget drop down using Selenium WebDriver

    • 5385 views
    • 5 answers
    • 0 votes
  • Train Asked on September 19, 2014 in Selenium WebDriver.

    Hi Lakshay,

    Thanks for your intervention. Sorry for delay in reply.

    Screenshot which I added above was a part of software product being under development in my organisation, therefore I am not able to share link of same. But I can provide you same type of control widgets through another site from where these type of controls were used.

    Go to http://www.jqwidgets.com/
    Then click ‘Demo’ link at top
    After that click ‘jqxGrid’ link(very first link)
    Click ‘DropDown Grid’ link in left menu
    On right side, a demo drop down gets loaded

    Here I am not able to handle control of that widget. Because SelectByVisibleText/option which we generally use in traditional drop down won’t works here.

    This whole site contains these types of various controls.

    Please help me regarding this.

    Regs,
    Lajish Lakshmanan

    • 5385 views
    • 5 answers
    • 0 votes
  • Train Asked on September 11, 2014 in Selenium WebDriver.

    Hi Vishal,

    Your suggestion works like charm. Finally it worked with ArrayList of WebElement type. I am sharing that code which can help a newbie in future.

    Here strelementidvalue is like xpath=/html/body/div[1]/div[5]/div[2]/div[5],/html/body/div[1]/div[5]/div[2]/div[5]/div/div[2],/html/body/div[1]/div[5]/div[2]

    It contains 3 xpaths separated by ‘commas’ being read from excel file. After that each xpath has been separated ad processed to do locate element in required webpage. Everytime I added returning value i.e Webelement is being appended into ArrayList of WebElement type and this list is being returned as value of below mentioned menthod.

    public ArrayList<WebElement> find_multipleElement(String strelementidvalue) throws IOException, InterruptedException{
    strelementList = new ArrayList<WebElement>();
    strarr1 = strelementidvalue.split(“=”);
    if(strarr1.length == 2) {
    strtext = strarr1[0];
    strelmntxpath = strarr1[1];
    if(strtext.equals(“xpath”)) {
    try{
    StringTokenizer st = new StringTokenizer(strelmntxpath,”,”);
    while(st.hasMoreTokens()){
    //strelement1 = st.nextToken();
    strelementList.add(driver.findElement(By.xpath(st.nextToken())));
    }
    } catch(NoSuchElementException e) {
    strelementList = null;
    }
    }
    else
    strelementList = null;
    }

    return strelementList;
    }

    Anyway Vishal, once again thanks for your help.

    • 10378 views
    • 7 answers
    • 0 votes
  • Train Asked on September 9, 2014 in Selenium WebDriver.

    Hi Vishal,

    Thanx  for your help…Yes you are right, Arraylist would be better option than arrays.

    • 10378 views
    • 7 answers
    • 0 votes
  • Train Asked on September 9, 2014 in Selenium WebDriver.

    Hi  Vishaalcbe,

    Please have a look over below mentioned code.

    private WebElement strelement = null;
    private WebElement[] strelement1 = null;
    private String strtext,strtemp,strelmntxpath;
    private String[] strarr1,strarr2,strarr3;

    public WebElement[] find_multipleElement(String strelementidvalue) throws IOException, InterruptedException{
    System.out.println(“Entered inside the new keyword”);
    strarr1 = strelementidvalue.split(“=”);
    if(strarr1.length == 2) {
    strtext = strarr1[0];
    strelmntxpath = strarr1[1];
    strarr2=strelmntxpath.split(“,”)
    if(strtext.equals(“xpath”)) {
    try {
    for(int i=0; i<strarr2.length; i++){
    WebElement strelmntxpath1 = driver.findElement(By.xpath(strarr2[i]));
    strelement1[i] = strelmntxpath1;
    }
    }catch (NoSuchElementException e) {
    strelement1 = null;
    }
    }
    }
    else
    strelement1 = null;

    return strelement1;
    }

    This is that method which should return an array of WebElement type

    Suppose : Value passed to the function as strelementidvalue is

    xpath=/html/body/div[1]/div/div[2]/div[3]/ul/li[1]/a/span[2],/html/body/div[1]/div/div[2]/div[3]/ul/li[9]/a/span[2],/html/body/div[1]/div/div[4]/div[3]/ul/li[12]/a/span[2]

    Please help me regarding this

    • 10378 views
    • 7 answers
    • 0 votes
  • Train Asked on September 4, 2014 in Selenium WebDriver.

    Hi Vaidy,

    This type of selection doesn’t works on JQ Widgets. Since u can’t  find any visible options or visible text in order to do exercise selectbyvisible text or option.

    Here is the html code for same
    <div id=”dropDownButtonContentjqxddb_CHAR_28 class=”jqx-dropdownlist-content style=”outline: medium none; background-color: transparent; border: medium none; float: left; position: relative; width: 240px; height: 25px; left: 0px; top: 0px;></div>

    These JQWidgets are not traditional drop down in which we can have single or multiple cases.

    Hi Lakshay,

    Would you have any suggestions for same.

    • 5385 views
    • 5 answers
    • 0 votes