How to get locator of the element that when we click on element , element is hidd from webpage. (Autosuggestive Dropdown) - selenium

How to get locator of the element that when we click on element , element is hidd from webpage. (Autosuggestive Dropdown)
Check this video: https://www.awesomescreenshot.com/video/14718103?key=d62686524ee669202bc48d3642ccc6ff
When clicking on the auto suggestive dropdown then, autosuggestive dropdwon value is hidden,
so how to get the locator for this.

Related

Print all hidden locator of drop down element values and select one by one of react bootstrap

We have react bootstrap app which has Dropdown field, trying to get Xpath and select drop down value however when selected drop down value html doesn't show locator or it has hidden element locator as shown in the picture.
Here in the picture, <input tag.. has aria-activedescendant="ch...demo-option-**0**"> for the first drop down value, if selected second drop down manually then it will change to < "ch...demo-option-**1**">
But this locator kind of hidden, unless mouse over on the drop down element this demo-option-0 doesn't show.
How to find this drop down element and get all values to print, select all check boxes.

Element locator not found

I use Selenium2Library with Robotframework. With my code source, I go to a web browser and after 2 windows open. Then I close one window after I try to click on an element locator on the window but the element isn't found. I have error : 'id=ggroup1Mon' did not match any elements after 5 seconds.
Open Browser http://10.70.150.34/avldisplay/MONITORING/Authentification
Wait Until Element Is Visible id=j_username
Click Element id=j_username
Input Text id=j_username 452
Wait Until Element Is Visible id=j_password
Click Element id=j_password
Input Text id=j_password 463425
Wait Until Element Is Visible xpath=//button[#type='submit']
Click Element xpath=//button[#type='submit']
${az}= List Windows
Select Window #{az}[1]
Close Window
Select Window #{az}[0]
Wait Until Element Is Visible id=ggroup1Mon
#Click Element id=ggroup1Mon

selenium send key for xpath not working

I want make automation for this web site
in this web site 3 text box are here check image
1st text box x path is /html[1]/body[1]/div[3]/div[1]/div[2]/div[1]/searchbar[1]/div[1]/div[1]/div[1]/div[1]/form[1]/div[1]/div[1]/div[1]/input[1]
here is my code
driver.findElement(By.xpath("/html[1]/body[1]/div[3]/div[1]/div[2]/div[1]/searchbar[1]/div[1]/div[1]/div[1]/div[1]/form[1]/div[1]/div[1]/div[1]/input[1]")).sendKeys("rio salon");
when I run this code I got this error
Exception in thread "main"
org.openqa.selenium.ElementNotInteractableException: Element is not reachable by keyboard
How can i fix it? I hope my xpath is correct.
The field has aria-hidden=true attribute, so you get ElementNotInteractableException. You need to click on the dropdown first to change the attribute to true
WebElement dropdown = driver.findElement(By.xpath("//*[#id='search-form']/div/div[1]/div/div[1]/span"));
dropdown.click();
WebElement textField = dropdown.findElement(By.xpath("./parent::div/following-sibling::input[contains(#class, 'ui-select-search')]"));
textField.sendKeys("rio salon");
You can click in an input field with a div or span tag, but you cannot type in the field. So, your XPath must be written with an input tag if you want to sendkeys or type in an input field. For example:
//input[contains(#placeholder,'Site')]

How can I select an element which appears in popup window using Selenium?

I have selected the popup window using cssSelector
ex:
WebElement a = TestApp.getInstance().getDriver().findElement(By.cssSelector("#PopupWindow0")) ;
now I want to select an element which is inside this popup.
After you retrieved WebElement 'a' you can call .findElement on it, for example:
a.findElement(By.id("example"));
This will search for all elements inside the pop-up window

How to traverse all the element of dropdown in Selenium WebDriver?

I have a drop down on my web page and I have to traverse this drop down and select the specific one.But its not so simple, In this the traversing should be show by the hover and at last the specific element or item should be selected.(The mouse hover action should start from the first element till the required element and then select the element).
You need to look into Select, there are a couple of different ways of selecting elements from the dropdown, below is one example.
Select dropdown = new Select(<WebElement>);
dropdown.selectByVisibleText("text");