How to get element from another element selenium using WebDriverWait?

user979033

Please see this:

IWebDriver driver;
WebDriverWait WebDriverWait;

public IWebElement Button
{
    return new WebDriverWait(driver, TimeSpan.FromSeconds(60)).Until(ExpectedConditions.ElementToBeClickable(By.XPath("bla bla")));
}

Now in case I want to search some IWebElement but instead of driver.FindElement I want to use another IWebElement I can do the following:

IWebElement webElement..
IWebElement webElement e = webElement.FindElement(By.XPath("my selector"));

So in this case I want to use WebDriverWait to instead of just webElement.FindElement.

Is it possible ?

Guy

WebDriverWait.Until() returns IWebElement, you can assign the returned value to a variable or just concat another method

IWebElement element = new WebDriverWait(driver, TimeSpan.FromSeconds(60)).Until(ExpectedConditions.ElementToBeClickable(By.XPath("bla bla")));
element.FindElement((By.XPath("my selector"));

Is the same as

new WebDriverWait(driver, TimeSpan.FromSeconds(60)).Until(ExpectedConditions.ElementToBeClickable(By.XPath("bla bla"))).FindElement(By.XPath("my selector"));

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Selenium WebdriverWait for element from another element

How to get a specific element from a list using Selenium with Python

How to get element(text) from a table using Selenium WebDriver with Python

How to get the text from mouseover popup element using Selenium Webdriver

How to retrieve data from the popup after clickable element trigger with WebDriverWait in Selenium Python?

Selenium webdriverwait to find element within element

Get text from html element using selenium

Get element from CQ class using Selenium

How to get data from a api using element of another api in reactjs

How to use WebDriverWait with two conditions for one element (Python, Selenium)

How to wait for a element to contain a specific attribute through Selenium and WebDriverWait?

How to get text of td element using selenium?

How to get attribute of element from Selenium?

How to get text from an element with selenium

Python Selenium: How to get the innerHTML from element

stale element even if using WebDriverWait

How to get the position of an element relative to canvas element using selenium in python?

How to get element in element from the list of elements in Java and Selenium

Selenium - How to get the text from an element but retaining child element source

How to get Element by Id from Another website

Get href from link above another element with Selenium

How to reach element inside of another element in selenium

Python Selenium Ubuntu: WebDriverWait will not find element

how to get an svg from one div element to another div element

Get Selenium Element from Watir Element

Unable to get an element using Selenium

Get a string from a selenium element

Selenium: How to get element of hover over element?

get text from element with <br> on its composition, using Python Selenium