Aim: To count links in footer section of a webpage. Instead of this: I want to write like this: Is this correct way to use “switch()” method in selenium ? Answer Unless I am mistaken, switch() is not a method belonging to the Selenium Webdriver. The method switchTo() is used to change your focus to a different window, tab or
Tag: selenium
warning: [unchecked] unchecked method invocation on creating a a custom Selenium ExcpectedCondition
I am trying to create a custom Selenium explicit wait with the following code then But I am getting these warnings while compilation Compiling with -Xlint:unchecked flag I get Any ideas on how to fix that? I am using Selenium 2.53 Answer I’m not familiar with this framework but according to the javadoc of the interface you are extending, you
Is webElement being called by passing the variable of WebElement into constructor of another “Actions” class?
I didn’t understand the last step. Answer The answer is definitely not. You can see this by debugging the test script you wrote It will take that element’s ‘By locator’ data (In this case it is By.cssSelector(“a[id=’nav-link-accountList’]”) ) add pass it to the moveToElement() function. Note: Just imagine if ‘WebElement’ being called every time when it is used somewhere the
XPath doesn’t locate element
I want to scrape links from this page. https://www.youtube.com/results?search_query=food+recepies None of these works for me. Answer This should work for the title. However, there are 27 of them. So, you might want to use Another thing is that you might want to wait until the elements are visible, enabled, clickable, etc., on the page. For this, you need to do
This version of ChromeDriver only supports Chrome version 99 Current browser version is 98.0.4758.102
My current chrome version : 98.0.4758.102 My current selenium version: 4.1.1 and cannot download chrome 99. My chrome 98 is updated to the last version, how do I get chrome 99 assuming it’s a beta version? Trace log : Answer Starting ChromeDriver 99.0.4844.51 Current browser version is 98.0.4758.102 Your chrome driver is for chrome version, which is not out yet.
Eclipse-Selenium-Alternative to Thread.sleep()
I am relatively new to the Test Automation and in particular to the Selenium. I am using Selenium Web-driver, Eclipse. One of the biggest problems I am experiencing is that our scripts are crashing due to the Internet speed or server performance. I currently use Thread.sleep() to solve the problem. However it is not a secret that Thread.sleep() enforces waiting
Validate dynamic (Span tag) Text using selenium Java
I need help with writing a logic to validate a dynamic text, below tag is having text which would be changing constantly( to 6 unique words), i need to validate if those 6 unique words are same as expected text. is there a way to validate that. Note – words are created in incremental way eg – a, ap, app,
Select value by text from a dynamic non select dropdown using Selenium Java
I want to select value by text from a dynamic non select dropdown. I did some research and I found this code: Basically it put the dropdowns options into a List element, and run through in a for loop, and if the options contains text, click it and break the loop. However it is not working with this type of
How to solve “org.openqa.selenium.support.ui.UnexpectedTagNameException: Element should have been “select” but was “input”” selenium error
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
Selenium – Find element at other element level
I have following piece of code to read value from one field: In this case I receive an empty string. If I do it in this way with long xpath it reads correct value: So my question is why using findElement at WebElement row doesn’t work. I’d like to do it this way because I need to read more values