Skip to main content

Posts

Showing posts from July, 2017

Query to find Nth Maximum and Minimum value from the Table

Hi, This query will fetch the rows which is the most large value / maximum value. --Maximum value SELECT MAX( spend )   FROM edw_aggregate.vw_agg_order_automation  WHERE spend < ( SELECT MAX( spend )                  FROM edw_aggregate.vw_agg_order_automation ); The above query will only fetch top most value from the table. If we want to fetch Nth  maximum / minimum value, look into this query.   --Nth Minimum/Max SELECT MIN( spend )   FROM edw_aggregate.vw_agg_order_automation   where spend in (SELECT top 5 spend FROM edw_aggregate.vw_agg_order_automation order by spend desc) Thanks

How to Handle Plain Javascript alert dialog buttons using Selenium with Java?

I have HTML page like this, < input type = "button" id = "btnlogin" value = "Login" onclick = "goToRegister()" > And the javascript is, < script language = "javscript" type = "text/javascript" > function goToRegister () { alert ( "Login Successful!" ); window . location . href = "Register.html" ; } </ script > In the selenium script , @Test public void goToRegisterPage () { System . out . println ( "goToRegisterPage" ); WebDriverWait wait = new WebDriverWait ( driver , 10 ); Alert alert = wait . until ( ExpectedConditions . alertIsPresent ()); alert . accept (); driver . get ( "file:///X://selenium//Register.html" ); } @BeforeMethod public void beforeMethod () { System . out . println ( "beforeMeth...