If there will ...
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:
If the result is null:
Switch the iframe and try the query again, like this:
The website might require some other user ...
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 ...
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 (...
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....
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
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;
WebElement duration = driver.FindElement(By.XPath("//span[@class='test-id__field-label']");
string duration_text = duration....