Skip to content
Advertisement

Tag: selenium

Is this correct way to use “switch()” method in selenium?

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

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

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

Advertisement