1.Actually last 2days im trying to solve this exception but still it' not working. So please suggest what could be the issue even if I'm using correct xpath but i'm still getting this exception.
- I'm using below xPath
deliveryChannel=//statusdropdown[@id="deliveryChannelField"]//select
for this xpath i'm getting exception , this Xpath i'm using in test case (Test(priority = 4))
printStatus = //statusdropdown[@id="releaseStatusDropDown"]//select
No exception here
@Test(priority = 4)
public void deliveryChannel() throws InterruptedException {
wait = new WebDriverWait(driver, 10);
String getDeliveryChannel = sftpCon.deliveryChannel("Search Criteria", 0);
//WebElement deliveryChannelDropDown = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(prop.getProperty("deliveryChannel"))));
WebElement deliveryChannelDropDown = wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(prop.getProperty("deleverysize"))));
System.out.println("Delevery Channel Text = "+deliveryChannelDropDown.getText());
select = new Select(deliveryChannelDropDown);
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
List<WebElement> listSelectApp = select.getOptions();
for (int i = 0; i < listSelectApp.size(); i++) {
String app = listSelectApp.get(i).getText();
if (getDeliveryChannel.contains(app)) {
listSelectApp.get(i).click();
}
}
}
@Test(priority = 5, retryAnalyzer = com.brcc.tool.RetryFailedTestCases.RetryTestCases.class)
public void getPrintStatus() throws InterruptedException {
wait = new WebDriverWait(driver, 10);
String printStatus = sftpCon.deliveryChannel("Search Criteria", 1);
WebElement printStatusDropDown = wait
.until(ExpectedConditions.visibilityOfElementLocated(By.xpath(prop.getProperty("printStatus"))));
select = new Select(printStatusDropDown);
List<WebElement> listSelectApp = select.getOptions();
for (int i = 0; i < listSelectApp.size(); i++) {
String app = listSelectApp.get(i).getText();
if (printStatus.contains(app)) {
listSelectApp.get(i).click();
}
}
}
Below are my html element
<div class="col-md-8">
<statusdropdown id="deliveryChannelField" ng-reflect-selected-status="print" ng-reflect-optional-status="[object Object]" ng-reflect-return-key="delivery_channel_name" ng-reflect-display-key="delivery_channel_description">
<select class="form-control" name="statusDropdown">
<!--bindings={ "ng-reflect-ng-for-of": "[object Object]"
}-->
<option value="print" ng-reflect-value="print">Print</option>
</select>
</statusdropdown>
</div>