New answers tagged

1

Why [4]? Shouldn't it be: string xpath = "//article[@class='shared__reader__xx reader__container__content'][1]/div[@class='chapter xx'][1]";


0

I don’t know you are still looking for solution or you have solved it. You can give it a try with click using Javascript. Click with java script doesn’t depends on that element is loaded properly in DOM or not. So no chance of timeout but you can use Thread.sleep(5000); for give sometime to load DOM. Explicit wait can throw timeoutException. If there will ...


0

Put a breakpoint on this line: WebElement message = driver.findElement (By.xpath("//*[@id='NoChainFound']")); In the browser window, that selenium opened press F12, then type in the console: document.querySelector("#NoChainFound") If the result is null: Switch the iframe and try the query again, like this: The website might require some other user ...


2

Reading your comments I see that app is based on Angular and this: This service appointment has no scheduling dependencies. Does that mean that: First you need to select service appointment (whatver that is) And then check for scheduling dependencies? If yes, then it looks like you need to: Click for something Wait until the element is shown (you can ...


3

It mostly seems like your DOM is changing dynamically, so please use explicit wait using proper locator that uniquely identifies the element you want: The below thread shows the full discussion on 'Element not found': How to analyse 'Element not Found' exceptions when working with Selenium The summary is to : 1. Trust your code and doubt SUT (...


4

This could be a timing issue(as most of the scenario you already discussed) when you're going to find it would not be present at that time on DOM, so you should try using WebDriverWait to wait until this element could be present as below:- WebDriverWait wait = new WebDriverWait(driver, 10); WebElement el = wait.until(ExpectedConditions....


1

xpath: //span[@text() = 'Duration'] css : span[class = 'test-id__field-label'] if you are using selenium then class : driver.findelement(by.class("test-id__field-label"); if you are using Portractor class: element(by.className("test-id__field-label"));


1

There are several options to achieve it since you have mentioned XPath, I'll just write how you could get to that text or get that text string duration = driver.FindElement(By.XPath("//span[@class='test-id__field-label']").Text; or WebElement duration = driver.FindElement(By.XPath("//span[@class='test-id__field-label']"); string duration_text = duration....


1

This is just the innerText. If you were to use something like string innerText = _browser.FindElement(By.ClassName("test-id__field-label")).Text; the inner text (Duration) would be returned


Top 50 recent answers are included