所以我有一个测试,其中包含以下代码:
public class ViewLineList
{
Browser browser = new Browser();
WebDriver driver;
public void viewLineList(String driverName)
{
driver = browser.getDriver(driverName);
//Navigate to System Facing
driver.manage().window().maximize();
driver.navigate().to("URL GOES HERE");
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
//Verify Line List is present
WebElement lineList = driver.findElement(By.xpath("/html/body/div/div/div/div/form/div/div[2]/div/div[2]/div"));
Assert.assertNotNull(lineList, "The Line List is empty");
Assert.assertEquals(true, lineList.isDisplayed(), "The line list is not displayed");
//Verify Columns are present
WebElement poEligibleColumn = driver.findElement(By.linkText("PO Eligible"));
WebElement patientColumn = driver.findElement(By.linkText("Patient/SSN"));
WebElement wardColumn = driver.findElement(By.linkText("Ward/Room"));
WebElement drugColumn = driver.findElement(By.linkText("Drug"));
WebElement dosageColumn = driver.findElement(By.linkText("Dosage"));
WebElement startDateColumn …
Run Code Online (Sandbox Code Playgroud) 我在python中有try-except块,我想在发生异常时什么都不做.我的代码如下:
for i in range(len(grid)):
for j in range(len(grid[i])):
try:
count = count > int(grid[i][j]) ? count : int(grid[i][j])
except:
//Do nothing here
Run Code Online (Sandbox Code Playgroud)
如果发现异常,我该怎么办?
谢谢.