I am having trouble with selenium , when trying to test a page with this code, if anybody can help me it would be awesome
public static void main(String[] args) {
System.setProperty("webdriver.chrome.driver", "C:\\Users\\emorales\\Documents\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.get("http://spicejet.com");
Select s= new Select(driver.findElement(By.id("ctl00_mainContent_ddl_Adult")));
s.selectByValue("3");
I keep getting
Starting ChromeDriver 2.41.578737
(49da6702b16031c40d63e5618de03a32ff6c197e) on port 38928
Only local connections are allowed.
Aug 02, 2018 11:28:01 AM org.openqa.selenium.remote.ProtocolHandshake
createSession
INFO: Detected dialect: OSS
Exception in thread "main"
org.openqa.selenium.ElementNotVisibleException: element not visible:
Element is
not currently visible and may not be manipulated
(Session info: chrome=67.0.3396.99)
(Driver info: chromedriver=2.41.578737
(49da6702b16031c40d63e5618de03a32ff6c197e),platform=Windows NT 6.1.7601
SP1 x86_64) (WARNING: The server did not provide any stacktrace
information)
Command duration or timeout: 0 milliseconds
Build info: version: '3.13.0', revision: '2f0d292', time: '2018-06-
25T15:32:14.902Z'
System info: host: 'PCPSE0015', ip: '10.1.0.151', os.name: 'Windows 7',
os.arch: 'amd64', os.version: '6.1', java.version: '10.0.2'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities {acceptInsecureCerts: false, acceptSslCerts: false,
applicationCacheEnabled: false, browserConnectionEnabled: false, browserName: chrome, chrome: {chromedriverVersion: 2.41.578737 (49da6702b16031..., userDataDir: C:\Users\emorales\AppData\L...}, cssSelectorsEnabled: true, databaseEnabled: false, goog:chromeOptions: {debuggerAddress: localhost:57509}, handlesAlerts: true, hasTouchScreen: false, javascriptEnabled: true, locationContextEnabled: true, mobileEmulationEnabled: false, nativeEvents: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: XP, platformName: XP, rotatable: false, setWindowRect: true, takesHeapSnapshot: true, takesScreenshot: true, unexpectedAlertBehaviour: , unhandledPromptBehavior: , version: 67.0.3396.99, webStorageEnabled: true}
Session ID: f530cf20d4e4ba57367449f87e4cbdfc at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.base/java.lang.reflect.Constructor.newInstance(Unknown Source) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166) at org.openqa.selenium.remote.http.JsonHttpResponseCodec.reconstructValue(JsonHttpResponseCodec.java:40) at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:80) at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:44) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158) at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548) at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:276) at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:83) at org.openqa.selenium.support.ui.Select.setSelected(Select.java:324) at org.openqa.selenium.support.ui.Select.selectByValue(Select.java:201) at DropDown.main(DropDown.java:15)
Aucun commentaire:
Enregistrer un commentaire