PhantomJS version : 2.1
Problem : My company just made a UI change in the app by using polymer and app url now contain /?dom=shadow
. Due to this phantomJS is breaking during sendKeys to input element.
Html Element :
<input type="text" class="GO43PFXOS GO43PFXDK" id="tbUsername" placeholder="Username" maxlength="50" style="margin-top: 10px; width: 310px; height: 30px; text-align: left;">
Code example :
System.setProperty("phantomjs.binary.path", "lib//phantomjs");
WebDriver d = new PhantomJSDriver();
d.get(url);
d.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
d.manage().window().maximize();
d.findElement(By.id("tbUsername")).sendKeys(userName);
I am getting the below error on last line of above code :
org.openqa.selenium.UnsupportedCommandException: TypeError - undefined is not a constructor (evaluating '_getTagName(currWindow).toLowerCase()')
I am using binary PhantomJS and getting the above error for mac and linux system.
Also got multiple post on different forum that PhantomJS can't work with polymer Application. Example:
- How do you write end-to-end tests for Polymer (JS) based application (circa May 2015)?
- https://github.com/detro/ghostdriver/issues/445
- https://github.com/detro/ghostdriver/issues/450
Please suggest how can I solve the above problem.