Guest User

Untitled

a guest
Jan 27th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.48 KB | None | 0 0
  1. //Selenium web driver
  2.  
  3. package javaapplication5;
  4.  
  5. import org.openqa.selenium.chrome.ChromeDriver;
  6.  
  7. public class JavaApplication5 {
  8.  
  9.  
  10. public static void main(String[] args) {
  11. System.setProperty("webdriver.chrome.driver", "C:\\Users\\One\\Desktop\\chromedriver.exe");
  12.  
  13. ChromeDriver driver=new ChromeDriver();
  14.  
  15.  
  16. driver.get("http://localhost:14323/WebApplication1/");
  17.  
  18. String a=driver.getTitle();
  19.  
  20. System.out.println(driver.getTitle());
  21.  
  22. driver.findElementByName("username").sendKeys("Hello");
  23.  
  24. driver.findElementByName("password").sendKeys("Hi");
  25.  
  26. driver.findElementByName("submit").click();
  27.  
  28. String b=driver.getTitle();
  29.  
  30. System.out.println(driver.getTitle());
  31.  
  32.  
  33.  
  34. if(a.equalsIgnoreCase(b)) {
  35. System.out.println("Title Match");
  36. }else {
  37. System.out.println("Title not matched");
  38. }
  39.  
  40. //driver.quit();
  41.  
  42. }
  43. }
  44.  
  45.  
  46.  
  47. <!DOCTYPE html>
  48. <!--
  49. To change this license header, choose License Headers in Project Properties.
  50. To change this template file, choose Tools | Templates
  51. and open the template in the editor.
  52. -->
  53. <html>
  54. <head>
  55. <title>First page</title>
  56. <meta charset="UTF-8">
  57. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  58. </head>
  59. <body>
  60. <form action="secondpage.html">
  61. UserName:<input type="text" name="username">
  62. Password:<input type="password" name="password">
  63. <input type="submit" name="submit">
  64. </form>
  65. </body>
  66. </html>
  67.  
  68.  
  69.  
  70. <!DOCTYPE html>
  71. <!--
  72. To change this license header, choose License Headers in Project Properties.
  73. To change this template file, choose Tools | Templates
  74. and open the template in the editor.
  75. -->
  76. <html>
  77. <head>
  78. <title>First page</title>
  79. <meta charset="UTF-8">
  80. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  81. </head>
  82. <body>
  83. <h1>This is 2nd page</h1>
  84. </body>
  85. </html>
  86. ------------------------------------------------------------------------------------------------------------------
  87. AutoIT Excel
  88.  
  89.  
  90. #include <Excel.au3>
  91. #include <MsgBoxConstants.au3>
  92. #include <GUIConstantsEx.au3>
  93. GUICreate("Custom MsgBox", 210, 80)
  94.  
  95. GUICtrlCreateLabel("This Script will open Microsoft Excel !!!!", 10, 10)
  96. $OKID = GUICtrlCreateButton("Ok", 10, 50, 50, 20)
  97. $ExitID = GUICtrlCreateButton("Exit", 150, 50, 50, 20)
  98. GUISetState() ;display the GUICreate
  99.  
  100. Do
  101. $msg = GUIGetMsg()
  102. Select
  103. Case $msg = $OKID
  104.  
  105. Local $oExcel = _Excel_Open()
  106.  
  107. Local $oWorkbook = _Excel_BookNew($oExcel)
  108.  
  109. _Excel_RangeWrite($oWorkbook, Default, "Test", "A1")
  110.  
  111. _Excel_BookSaveAs($oWorkbook, @TempDir & "\_Excel12.xls", Default, True)
  112.  
  113. _Excel_RangeWrite($oWorkbook, Default, "2nd Test", "B1")
  114.  
  115. _Excel_BookSave($oWorkbook)
  116. MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_BookSave Example 1", "Workbook has been successfully saved as '" & @TempDir & "\_Excel.xls'.")
  117. _Excel_Close($oExcel)
  118. $msg = $GUI_EVENT_CLOSE or $msg = $ExitID
  119.  
  120. Case $msg = $ExitID
  121. case $msg = $GUI_EVENT_CLOSE
  122. //MsgBox(0,"You Clicked on", "Close")
  123. EndSelect
  124. Until $msg = $GUI_EVENT_CLOSE or $msg = $ExitID
  125.  
  126. --------------------------------------------------------------------------------------------------------------------------
Add Comment
Please, Sign In to add comment