Advertisement
Guest User

Untitled

a guest
Mar 27th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.70 KB | None | 0 0
  1. package com.packt.webdriver.chapter3;
  2.  
  3. import org.openqa.selenium.*;
  4. import org.openqa.selenium.firefox.FirefoxDriver;
  5. import org.openqa.selenium.interactions.*;
  6.  
  7. public class ActionBuildPerform
  8. {
  9. public static void main(String[] args)
  10. {
  11. System.setProperty("webdriver.gecko.driver","C:\Users\Pragati Chaturvedi\Desktop\Selenium Web Driver\geckodriver.exe");
  12. WebDriver driver = new FirefoxDriver();
  13. driver.get("C:\Users\Pragati Chaturvedi\Desktop\Selenium Web Driver\8850OS_Code\Chapter 2\HTML\Selectable.html");
  14. WebElement one = driver.findElement(By.name("one"));
  15. WebElement three = driver.findElement(By.name("three"));
  16. WebElement five = driver.findElement(By.name("five")); // Add all the actions into the Actions builder.
  17. Actions builder = new Actions(driver);
  18. builder.keyDown(Keys.CONTROL).click(one).click(three).click(five).keyUp(Keys.CONTROL); // Generate the composite action.
  19. Action compositeAction = builder.build(); //Perform the composite action.
  20. compositeAction.perform();
  21. }
  22.  
  23. 1490634882750 geckodriver INFO Listening on 127.0.0.1:19171
  24. 1490634883544 mozprofile::profile INFO Using profile path
  25. C:UsersPRAGAT~1AppDataLocalTemprust_mozprofile.dcx9kJg3PT9r
  26. 1490634883559 geckodriver::marionette INFO Starting browser C:Program
  27. FilesMozilla Firefoxfirefox.exe with args []
  28. 1490634883575 geckodriver::marionette INFO Connecting to Marionette on
  29. localhost:59372
  30. [GFX1]: Potential driver version mismatch ignored due to missing DLLs
  31. 0.0.0.0 and 0.0.0.0
  32. 1490634885334 Marionette INFO Listening on port 59372
  33. [GFX1]: Potential driver version mismatch ignored due to missing DLLs
  34. 0.0.0.0 and 0.0.0.0
  35. Mar 27, 2017 1:14:49 PM org.openqa.selenium.remote.ProtocolHandshake
  36. createSession
  37. INFO: Detected dialect: W3C
  38. JavaScript error: chrome://marionette/content/listener.js, line 1081:
  39. NS_ERROR_UNKNOWN_PROTOCOL:
  40. Exception in thread "main" org.openqa.selenium.WebDriverException: Reached
  41. error page: about:neterror?
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51. e=unknownProtocolFound&u=c%3A%5CUsers%5CPragati%2520Chaturvedi%5CDesktop%5CSelenium%2520Web%2520Driver%5C8850OS_Code%5CChapter%25202%5CHTML%5CSelectable.html&c=&f=regular&d=Firefox%20doesn%E2%80%99t%20know%20how%20to%20open%20this%20address%2C%20because%20one%20of%20the%20following%20protocols%20%28c%29%20isn%E2%80%99t%20associated%20with%20any%20program%20or%20is%20not%20allowed%20in%20this%20context.
  52. Build info: version: '3.3.1', revision: '5234b32', time: '2017-03-10
  53. 09:04:52 -0800'
  54. System info: host: 'PRAGZ-LAPPY', ip: '10.0.0.110', os.name: 'Windows 10',
  55. os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_121'
  56. Driver info: org.openqa.selenium.firefox.FirefoxDriver
  57. Capabilities
  58. [{moz:profile=C:UsersPRAGAT~1AppDataLocalTemprust_mozprofile.dcx9kJg3PT9r,
  59. rotatable=false, timeouts={implicit=0, page load=300000, script=30000},
  60. pageLoadStrategy=normal, platform=ANY, specificationLevel=0,
  61. moz:accessibilityChecks=false, acceptInsecureCerts=false,
  62. browserVersion=52.0.1, platformVersion=10.0, moz:processID=19664,
  63. browserName=firefox, platformName=windows_nt}]
  64. Session ID: 430d1b8b-4d2c-4cdc-939e-ccfa8fb543f4
  65. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
  66. at
  67.  
  68. sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorI mpl.java:62)
  69. at
  70. sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorA ccessorImpl.java:45)
  71. at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
  72. at
  73. org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:133)
  74. at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:99)
  75. at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:43)
  76. at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:163)
  77. at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
  78. at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:604)
  79. at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:325)
  80. at com.packt.webdriver.chapter3.ActionBuildPerform.main(ActionBuildPerform.java:13)
  81.  
  82. <!doctype html>
  83. <html lang="en">
  84. <head>
  85. <meta charset="utf-8" />
  86. <title>jQuery UI Selectable - Display as grid</title>
  87. <link rel="stylesheet"
  88. href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
  89. <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
  90. <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
  91. <link rel="stylesheet" href="/resources/demos/style.css" />
  92. <style>
  93. #feedback { font-size: 1.4em; }
  94. #selectable .ui-selecting { background: #FECA40; }
  95. #selectable .ui-selected { background: #F39814; color: white; }
  96. #selectable { list-style-type: none; margin: 0; padding: 0; width: 450px; }
  97. #selectable li { float: left; width: 100px; height: 80px; font-size: 4em;
  98. text-align: center; }
  99. </style>
  100. <script>
  101. $(function() {
  102. $( "#selectable" ).selectable();
  103. });
  104. </script>
  105. </head>
  106. <body>
  107. <ol id="selectable">
  108. <li class="ui-state-default" name="one">1</li>
  109. <li class="ui-state-default" name="two">2</li>
  110. <li class="ui-state-default" name="three">3</li>
  111. <li class="ui-state-default" name="four">4</li>
  112. <li class="ui-state-default" name="five">5</li>
  113. <li class="ui-state-default" name="six">6</li>
  114. <li class="ui-state-default" name="seven">7</li>
  115. <li class="ui-state-default" name="eight">8</li>
  116. <li class="ui-state-default" name="nine">9</li>
  117. <li class="ui-state-default" name="ten">10</li>
  118. <li class="ui-state-default" name="eleven">11</li>
  119. <li class="ui-state-default" name="twelve">12</li>
  120. </ol>
  121. </body>
  122. </html>
  123.  
  124. compositeAction.perform();
  125. } <-------
  126. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement