我们如何将时间戳转换为日期?
该表具有一个字段,start_ts它是的timestamp格式:
'05/13/2016 4:58:11.123456 PM'
Run Code Online (Sandbox Code Playgroud)
我需要查询表并找到表中的最大值和最小值timestamp,但我无法.
Select max(start_ts)
from db
where cast(start_ts as date) = '13-may-2016'
Run Code Online (Sandbox Code Playgroud)
但查询不返回任何值.
请帮我找一个日期的最大时间戳.
弹出后,我使用下面的代码截取应用程序的屏幕截图.
Alert alert = driver.switchTo().alert();
File scrFile= ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
FileUtils.copyFile(scrFile, new File("G:\\Screens\\sc1.jpg"));
String alertMsg = alert.getText();
System.out.println(alertMsg);
alert.accept();
Run Code Online (Sandbox Code Playgroud)
但它正在抛出这个例外
线程"main"中的异常org.openqa.selenium.UnhandledAlertException:存在模式对话框:评估名称已存在.
但是如果删除屏幕截图程序,代码工作正常.
以下代码适用于Firefox和Chrome,但在IE中执行时显示错误.
System.setProperty("webdriver.ie.driver", "G:\\Selenium\\IEDriver\\IEDriverServer.exe");
WebDriver driver=new InternetExplorerDriver();
driver.get("https://www.google.co.in/?gws_rd=cr&ei=ZDziUrLDEuLpiAeD44H4BA");
driver.findElement(By.name("q")).sendKeys("Selenium");
Run Code Online (Sandbox Code Playgroud)
显示的错误是 I/O exception (java.net.SocketException) caught when processing request: Software caused connection abort: recv failed
Jan 24, 2014 3:44:04 PM org.apache.http.impl.client.DefaultRequestDirector tryExecute
INFO: Retrying request
Exception in thread "main" org.openqa.selenium.NoSuchElementException: