How to select an element in this web element :
this input is a text type and not a select option !!!
Type some characters (or all/none of them) in that input box
Wait until the options appear
Take the identifier (id/XPath/class/CSS/etc.) of that element (option) (maybe it is a div)
F12 in Chrome > click on the magnifier > click on the option
F12 in Firefox/Internet Explorer > click on the arrow > click on the option
Click on that elements / take its content
Related
I do have the following code to click a Google button that open a pop-up and then it selects the second Item. It worked fine but now is failing, I guess that due to ID name changed. I do not remember how I Inpectioned the pop-up ID since it does not appears in the "Inpection" Chrome Window.
numOpiniones.click()
self.driver.find_element(By.XPATH,"//button[#data-value='Ordenar']").click()
sleep(random.uniform(1, 1.5))
self.driver.find_element(By.XPATH, "//li[#role='menuitemradio' and #data-index='1']").click()
"menuitemradio" does not exists anymore but I can not see that element in the inspector panel when is created/displayed.
enter image description here
You can use the following css path
driver.find_element(By.CSS_SELECTOR, '#hovercard > #action-menu > [data-index="1"]')
I'm trying to select a list option from the dropdown by sending text (ie; one of the option is: "MyName") to search bar for the dropdown option, (typeAheadInputSelection). After enter the text the selection is typed on the search bar and option is highlighted, however, the highlighted drop down list does not disappear after hitting enter button.
I'm able to type text and press enter (or tab) however, the selected dropdown overlaps and unable to move onto next web element to take actions.
I have tried below code:
IWebelement webElement= driver.FindElement(By.Id("userType");
webElement.SendKeys("name" + Keys.tab)
Im making a automated test but the input fields doesn't have any specific id and classes. I don't want to select everything by using xpath so i thought i was going to use the Press Keys function. After i put the text in the first input i do the function:
Press Keys LOCATOR TAB
After that i used the tab button, it goes to the next form but how do input text in the form?
I know there is the input text function but it needs the locator for entering text. How can i input text without using the input text locator ?
Try to still take the xpath even if it has no specific id or class, it also works with an xpath like this: // html / body / table / tbody / tr [4] / td / center / form / table / tbody / tr [ 4] / td.
Example Input Text:
Input Text [locator, text, clear = True].
Example Press Keys:
Press Keys, locator, ALT
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
When I am recording my script my scrpit is failing when it is coming to the part of clicking the "add comment" icon. The error I am getting is that the element is not found. The html script is :
a id="cmt_place" class="btn add_comment" onclick="javascript:SNI.Community.Toolbox.TopNavCheckandShow()">
So I am confused which command I should use and what the target and value should be so that when the test runs it should be able to automatically click the add comment icon.
New Test Case
open /registration/login.esi
type id=up-ur-email
type id=up-ur-password
click css=#up-ur-widget-login > #up-ur-widget-nav-item-off > a > em
open /home/home.esi
click link=TEST_upload
click id=Add Comment
click id=commenttext
type id=commenttext test123
click css=#post-comment-omnt > em
clickAndWait link=Log Out
open /registration/login.esi
type id=up-ur-email
type id=up-ur-password
click css=#up-ur-widget-login > #up-ur-widget-nav-item-off > a > em
open /home/home.esi
click link=TEST_upload
Pause 30000
click id=Add Comment
click id=commenttext
type id=commenttext test123
click css=#post-comment-omnt > em
clickAndWait link=Log Out
pause command will pause 3 second before click the Add comment button.
Try this.
Thank you.
use Xpath of comment box in target field and use pause & setCursorPosition command
pause to wait for some time and setCursorPosition command to point comment box
open /registration/login.esi
type id=up-ur-email
type id=up-ur-password
click css=#up-ur-widget-login > #up-ur-widget-nav-item-off > a > em
open /home/home.esi
click link=TEST_upload
click id=Add Comment(use Xpath of comment box instead of this)
pause 2000
setCursorPosition id=commenttext
click id=commenttext
type id=commenttext test123
click css=#post-comment-omnt > em
clickAndWait link=Log Out