3
<svg viewBox="0 0 24 24" style="display: inline-block; fill: rgb(224,    224, 224); height: 24px; width: 24px; transition: all 450ms cubic-bezier(0.23, 1, 0.32, 1) 0ms; position: absolute; right: 0px; top: 14px; -webkit-user-select: none;"><path d="M7 10l5 5 5-5z"></path></svg>

You can find the page at: apply.autogravity.com. The page doesn't use the typical 'select' element found on other websites. Any help would be great.

5
  • FYI: I've attempted using the select method and can't capture anything. I've also attempted the container option, but i can't capture anything since, the drop down options are not inside the svg view box element. I can only get so far as to click the drop down arrow, but i cannot get it to hover to any value as well.
    – Punns
    Aug 8, 2016 at 19:32
  • 1
    where is your code? what exception(s) did you get?
    – Yu Zhang
    Aug 8, 2016 at 21:44
  • I don't get exception, it just cannot find the elements. Here is a sample: Actions move = new Actions(instance); move.moveToElement(di().findElement(By.("Honda"))).click().build(); this is my move mouse to method
    – Punns
    Aug 8, 2016 at 23:56
  • The dropdown names like 'Honda' are being saved as 'div' elements. i attempted to read the page source and find the div, but it doesn't find it either
    – Punns
    Aug 9, 2016 at 0:03
  • Pls accept the most helpful answer, So question will not be in Active queue for long Jan 6, 2017 at 13:04

2 Answers 2

1

Note : For the select dropdown , HTML page should have <select> and <option> tag element.


Solution :

As part of answer, to find element <svg> , Best xapth is this:

//div[@id='make-select']//button/div/*

Approach to Select Car :

For select car from the dropdown, you can use tradition way to select your element :

Step 1 : Click on dropdown first :

driver.findElement(By.id("make-select")).click();

Step 2 : Select Car from the dropw down. Just pass your car name as parameter :

String strCar = "Nissan"; 

driver.findElement(By.xpath("//div[@itemprop='itemListElement']//div[text()='"+strCar+"']")).click();

Note : Put some sleep or wait between two click events for flawless script.

0

Solution:

WebElement listbox_webelement =
drive.findElement(By.xpath("write_your_xpath_of_element"));


listbox_webelement.click() [ Expected to list get visible ]



   Select select = new Select(listbox_webelement);


   select.sendKeys("Text_From_Your_Listbox");
                  OR


   listbox_webelement.sendKeys("Text_From_Your_Listbox");

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.