I’m going to get the default selected value of the below dropdown I wrote below code to do it. But this throws the following error org.openqa.selenium.support.ui.UnexpectedTagNameException: Element should have been “select” but was “input” How can I fix this? same code is working perfectly for dropdowns that don’t have “value” attribute. Answer The only explanation is there is another element
Tag: webdriver
Selenium Firefox webdriver cannot see webelement given but Chrome can?
I have a test case that changes the time value in the dialog pop-up. To do so, I created a method named setDateInput. When it is called by this code below, Chrome driver changed the startInput to 23:55 but firefox does neither clear() nor sendKeys(). So, my question is, is there a different way to handle the text type input
Remove Bot-Identyfing Features from Firefox WebDriver Source Code?
One of the ways WebDriver identifies itself as a bot to external websites is by setting the webdriver-active flag to true. A user on SO suggested that it is possible modify Chrome Driver source code to remove all bot-identifying attributes (see this and this response). Is it possible to achieve a similar outcome w/ Firefox by modifying the source code
How can we pass in an ExpectedConditions as a parameter to wait.until in Selenium Java?
I’m finding trouble passing in an ExpectedConditions as a parameter in a method to wait.until(). The wait.until() expects a function to be passed in. I am relatively new to Java, and would appreciate the assistance. Offending code: wait.until() expects a function to be passed into it, which looks like ExpectedConditions.urlToBe(“http://www.test.com”). I am trying to make a method that could be
why nothing is returned when reading distance displayed on the site mentioned in the body using selenium webdriver
I am trying to read distance value from ‘Distance by Land Transport’ field from the site ( https://www.freemaptools.com/distance-between-canada-postcodes.htm) but I am getting nothing though the calculated distance value is displaying in the field. Below is my code and the site used. Questions: why I am getting nothing? ( please see below code String variable: strDist shows nothing) Interestingly, when I
Reach for the deep nested element using Selenium WebDriver (Java)
I looked through a lot of topics on Stackoverflow and tried several recommendations but could hardly succeed in resolving my particular case. I’m trying to automate Google Cloud Pricing Calculator using Selenium WebDriver + Java. I need insert the Number of instances (the first input area on the page) using Java code. My Java code is following: But NoSuchElementException is
JAVA – How to replace string in a binary file (.exe) using regex pattern [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 1 year ago. Improve this question I need to read a file named “chromedriver.exe” and replace all the occurrences of a string that starts with “cdc_” and is 26 characters long.
Automating a login with out providing the password via selenium Webdriver
I am trying to create an automated test to one of my accounts. I have manage to do so but i have to provide the password via driver.sendKeys(). Any idea on how i could automate this part without providing my password? I have attached the code below Answer There are multiple ways to avoid password plain in your tests, here
I am getting Null pointer Exception while fetching data from the excel sheet [duplicate]
This question already has answers here: What is a NullPointerException, and how do I fix it? (12 answers) Closed 2 years ago. Code: } I am fetching the data from the excel sheet while performing test I am getting below error. Error: [Utils] [ERROR] [Error] java.lang.NullPointerException at dataDrivenFramework.dataDrivenFramework.ExcelDataConfig.getData(ExcelDataConfig.java:31) at dataDrivenFramework.dataDrivenFramework.ContactUsFormTest.formData(ContactUsFormTest.java:63) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) Here
Handle/Accept cookie pop-up in Selenium
I am trying to ‘accept the cookies’ on the homepage, but my code doesn’t work. I tried to get the new window handles and then identify the subsequent Xpath for the frame and Accept button but it never work. Answer You no need to switch frame in your case, because there is no frame present in your page. Just inspect