I have the next code, this code works with chrome driver but with phantom js 1.4.4 library and 2.1.1 driver is not working im not able to locate the elements
This issue doesnot appear with chrome driver.
Code trials:
public void test1()
{
DesiredCapabilities caps = new DesiredCapabilities();
((DesiredCapabilities) caps).setJavascriptEnabled(true);
((DesiredCapabilities) caps).setCapability("takesScreenshot",true);
((DesiredCapabilities) caps).setCapability(PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY, "/Users/santiagogalicia/downloads/phantomjs");
caps.setJavascriptEnabled(true);
String [] phantomJsArgs = {"--web-security=no", "--ignore-ssl-errors=yes"};
caps.setCapability(PhantomJSDriverService.PHANTOMJS_CLI_ARGS, phantomJsArgs);
WebDriver driver = new PhantomJSDriver(caps);
Dimension dimension = new Dimension(400,600);
driver.manage().window().setSize(dimension);
driver.get("https://stage-commissionist.payclip.com/#/");
WebDriverWait wait = new WebDriverWait(driver, 10);
wait.until(ExpectedConditions.elementToBeClickable(By.id("formUsername")));
driver.findElement(By.id("formUsername")).sendKeys(User);
driver.findElement(By.id("formPassword")).sendKeys(Password);
driver.findElement(By.cssSelector(".btn")).click();
driver.close();
}
I tried change the driver and with other driver works
The error that I am seeing:
[ERROR - 2019-02-07T19:15:26.476Z] Session [b736bad0-2b0c-11e9-b0db-6d1517ea5006] - page.onError - msg: ReferenceError: Can't find variable: Set phantomjs://platform/console++.js:263 in error
[ERROR - 2019-02-07T19:15:26.476Z] Session [b736bad0-2b0c-11e9-b0db-6d1517ea5006] - page.onError - stack:
(anonymous function) (https://stage-commissionist.payclip.com/static/js/1.ea7f0607.chunk.js:1)
f (https://stage-commissionist.payclip.com/#/:1)
phantomjs://platform/console++.js:263 in error
[ERROR - 2019-02-07T19:15:26.759Z] WebElementLocator - _handleLocateCommand - Element(s) NOT Found: GAVE UP. Search Stop Time: 1549566926721