You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
public SampleTest()
{
}
@Test
public void verify()
{
//WebDriver driver = new HtmlUnitDriver(); -- works fine in this case
WebDriver driver = new HtmlUnitDriver(BrowserVersion.FIREFOX_38);
driver.get("http://www.google.com");
System.out.println(driver.getTitle());
driver.findElement(By.name("q")).clear();
driver.findElement(By.name("q")).sendKeys("selenium");
driver.findElement(By.name("btnG")).click();
System.out.println(driver.getTitle());
String abc = driver.getTitle();
Assert.assertTrue(abc.contains("selenium"));
driver.quit();
}
Google
Jul 20, 2017 6:07:39 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error
WARNING: CSS error: 'https://www.google.com.pk/?gws_rd=cr,ssl&ei=GatwWY2dOcyuUojqnYAG' [1:6925] Error in expression; ':' found after identifier "progid".
Jul 20, 2017 6:07:39 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error
WARNING: CSS error: 'https://www.google.com.pk/?gws_rd=cr,ssl&ei=GatwWY2dOcyuUojqnYAG' [1:7638] Error in expression; ':' found after identifier "progid".
Jul 20, 2017 6:07:39 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error
WARNING: CSS error: 'https://www.google.com.pk/?gws_rd=cr,ssl&ei=GatwWY2dOcyuUojqnYAG' [1:10007] Error in expression; ':' found after identifier "progid".
Jul 20, 2017 6:07:39 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error
WARNING: CSS error: 'https://www.google.com.pk/?gws_rd=cr,ssl&ei=GatwWY2dOcyuUojqnYAG' [1:10543] Error in expression; ':' found after identifier "progid".
Jul 20, 2017 6:07:39 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error
WARNING: CSS error: 'https://www.google.com.pk/?gws_rd=cr,ssl&ei=GatwWY2dOcyuUojqnYAG' [1:22616] Error in expression; ':' found after identifier "progid".
Jul 20, 2017 6:07:39 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error
WARNING: CSS error: 'https://www.google.com.pk/?gws_rd=cr,ssl&ei=GatwWY2dOcyuUojqnYAG' [1:26696] Error in expression; ':' found after identifier "progid".
Jul 20, 2017 6:07:39 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error
WARNING: CSS error: 'https://www.google.com.pk/?gws_rd=cr,ssl&ei=GatwWY2dOcyuUojqnYAG' [1:27142] Error in expression; ':' found after identifier "progid".
Jul 20, 2017 6:07:40 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error
WARNING: CSS error: 'https://www.google.com.pk/?gws_rd=cr,ssl&ei=GatwWY2dOcyuUojqnYAG' [1:923] Error in expression; ':' found after identifier "progid".
Jul 20, 2017 6:07:40 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error
WARNING: CSS error: 'https://www.google.com.pk/?gws_rd=cr,ssl&ei=GatwWY2dOcyuUojqnYAG' [1:1636] Error in expression; ':' found after identifier "progid".
Jul 20, 2017 6:07:40 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error
WARNING: CSS error: 'https://www.google.com.pk/?gws_rd=cr,ssl&ei=GatwWY2dOcyuUojqnYAG' [1:4005] Error in expression; ':' found after identifier "progid".
Jul 20, 2017 6:07:40 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error
WARNING: CSS error: 'https://www.google.com.pk/?gws_rd=cr,ssl&ei=GatwWY2dOcyuUojqnYAG' [1:4541] Error in expression; ':' found after identifier "progid".
Jul 20, 2017 6:07:40 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error
WARNING: CSS error: 'https://www.google.com.pk/?gws_rd=cr,ssl&ei=GatwWY2dOcyuUojqnYAG' [1:10036] Error in expression; ':' found after identifier "progid".
Jul 20, 2017 6:07:40 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error
WARNING: CSS error: 'https://www.google.com.pk/?gws_rd=cr,ssl&ei=GatwWY2dOcyuUojqnYAG' [1:10528] Error in expression; ':' found after identifier "progid".
Jul 20, 2017 6:07:40 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error
WARNING: CSS error: 'https://www.google.com.pk/?gws_rd=cr,ssl&ei=GatwWY2dOcyuUojqnYAG' [1:13846] Error in expression. (Invalid token " ". Was expecting one of: , "inherit", , , , , , <LENGTH_PX>, <LENGTH_CM>, <LENGTH_MM>, <LENGTH_IN>, <LENGTH_PT>, <LENGTH_PC>, <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <TIME_MS>, <TIME_S>, <FREQ_HZ>, <FREQ_KHZ>, <RESOLUTION_DPI>, <RESOLUTION_DPCM>, , , , .)
Jul 20, 2017 6:07:40 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error
WARNING: CSS error: 'https://www.google.com.pk/?gws_rd=cr,ssl&ei=GatwWY2dOcyuUojqnYAG' [1:13870] Error in expression. (Invalid token " ". Was expecting one of: , "inherit", , , , , , <LENGTH_PX>, <LENGTH_CM>, <LENGTH_MM>, <LENGTH_IN>, <LENGTH_PT>, <LENGTH_PC>, <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <TIME_MS>, <TIME_S>, <FREQ_HZ>, <FREQ_KHZ>, <RESOLUTION_DPI>, <RESOLUTION_DPCM>, , , , .)
FAILED: verify
org.openqa.selenium.ElementNotVisibleException: You may only interact with visible elements
Build info: version: '2.46.0', revision: '87c69e2', time: '2015-06-04 16:16:47'
System info: host: 'SS01-NBK-035', ip: '10.1.18.37', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_51'
Driver info: driver.version: unknown
at org.openqa.selenium.htmlunit.HtmlUnitWebElement.verifyCanInteractWithElement(HtmlUnitWebElement.java:280)
at org.openqa.selenium.htmlunit.HtmlUnitWebElement.click(HtmlUnitWebElement.java:138)
at test1.phantomTest.verify(phantomTest.java:68)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
at org.testng.SuiteRunner.run(SuiteRunner.java:240)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:230)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:76)
===============================================
Default test
Tests run: 1, Failures: 1, Skips: 0
===============================================
Default suite
Total tests run: 1, Failures: 1, Skips: 0
[TestNG] Time taken by org.testng.reporters.XMLReporter@28864e92: 16 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter2@1888ff2c: 7 ms
[TestNG] Time taken by org.testng.reporters.jq.Main@7cdbc5d3: 42 ms
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@33a10788: 46 ms
[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@357246de: 6 ms
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 8 ms
Please suggest a solution or a way around.
The text was updated successfully, but these errors were encountered:
OS:
Windows 7 64-bit
Selenium Version:
Selenium web driver 3.4.0
Browser:
HtmlUnitDriver (htmlunit-driver-2.26.jar)
Expected Behavior -
Sample test script should work fine with the BrowserVersion argument.
Actual Behavior -
Sample script works fine with HtmlUnitDriver but gives an error whenever a browser version is specified with the HtmlUnitDriver
Steps to reproduce -
sample code is as below:
package test1;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
import org.testng.Assert;
import org.testng.annotations.Test;
import com.gargoylesoftware.htmlunit.BrowserVersion;
public class SampleTest {
}
The output error which i'm getting is,
[TestNG] Running:
C:\Users\naukhaiz.ahmad\AppData\Local\Temp\testng-eclipse--1506748139\testng-customsuite.xml
Google
Jul 20, 2017 6:07:39 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error
WARNING: CSS error: 'https://www.google.com.pk/?gws_rd=cr,ssl&ei=GatwWY2dOcyuUojqnYAG' [1:6925] Error in expression; ':' found after identifier "progid".
Jul 20, 2017 6:07:39 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error
WARNING: CSS error: 'https://www.google.com.pk/?gws_rd=cr,ssl&ei=GatwWY2dOcyuUojqnYAG' [1:7638] Error in expression; ':' found after identifier "progid".
Jul 20, 2017 6:07:39 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error
WARNING: CSS error: 'https://www.google.com.pk/?gws_rd=cr,ssl&ei=GatwWY2dOcyuUojqnYAG' [1:10007] Error in expression; ':' found after identifier "progid".
Jul 20, 2017 6:07:39 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error
WARNING: CSS error: 'https://www.google.com.pk/?gws_rd=cr,ssl&ei=GatwWY2dOcyuUojqnYAG' [1:10543] Error in expression; ':' found after identifier "progid".
Jul 20, 2017 6:07:39 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error
WARNING: CSS error: 'https://www.google.com.pk/?gws_rd=cr,ssl&ei=GatwWY2dOcyuUojqnYAG' [1:22616] Error in expression; ':' found after identifier "progid".
Jul 20, 2017 6:07:39 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error
WARNING: CSS error: 'https://www.google.com.pk/?gws_rd=cr,ssl&ei=GatwWY2dOcyuUojqnYAG' [1:26696] Error in expression; ':' found after identifier "progid".
Jul 20, 2017 6:07:39 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error
WARNING: CSS error: 'https://www.google.com.pk/?gws_rd=cr,ssl&ei=GatwWY2dOcyuUojqnYAG' [1:27142] Error in expression; ':' found after identifier "progid".
Jul 20, 2017 6:07:40 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error
WARNING: CSS error: 'https://www.google.com.pk/?gws_rd=cr,ssl&ei=GatwWY2dOcyuUojqnYAG' [1:923] Error in expression; ':' found after identifier "progid".
Jul 20, 2017 6:07:40 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error
WARNING: CSS error: 'https://www.google.com.pk/?gws_rd=cr,ssl&ei=GatwWY2dOcyuUojqnYAG' [1:1636] Error in expression; ':' found after identifier "progid".
Jul 20, 2017 6:07:40 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error
WARNING: CSS error: 'https://www.google.com.pk/?gws_rd=cr,ssl&ei=GatwWY2dOcyuUojqnYAG' [1:4005] Error in expression; ':' found after identifier "progid".
Jul 20, 2017 6:07:40 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error
WARNING: CSS error: 'https://www.google.com.pk/?gws_rd=cr,ssl&ei=GatwWY2dOcyuUojqnYAG' [1:4541] Error in expression; ':' found after identifier "progid".
Jul 20, 2017 6:07:40 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error
WARNING: CSS error: 'https://www.google.com.pk/?gws_rd=cr,ssl&ei=GatwWY2dOcyuUojqnYAG' [1:10036] Error in expression; ':' found after identifier "progid".
Jul 20, 2017 6:07:40 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error
WARNING: CSS error: 'https://www.google.com.pk/?gws_rd=cr,ssl&ei=GatwWY2dOcyuUojqnYAG' [1:10528] Error in expression; ':' found after identifier "progid".
Jul 20, 2017 6:07:40 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error
WARNING: CSS error: 'https://www.google.com.pk/?gws_rd=cr,ssl&ei=GatwWY2dOcyuUojqnYAG' [1:13846] Error in expression. (Invalid token " ". Was expecting one of: , "inherit", , , , , , <LENGTH_PX>, <LENGTH_CM>, <LENGTH_MM>, <LENGTH_IN>, <LENGTH_PT>, <LENGTH_PC>, <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <TIME_MS>, <TIME_S>, <FREQ_HZ>, <FREQ_KHZ>, <RESOLUTION_DPI>, <RESOLUTION_DPCM>, , , , .)
Jul 20, 2017 6:07:40 PM com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error
WARNING: CSS error: 'https://www.google.com.pk/?gws_rd=cr,ssl&ei=GatwWY2dOcyuUojqnYAG' [1:13870] Error in expression. (Invalid token " ". Was expecting one of: , "inherit", , , , , , <LENGTH_PX>, <LENGTH_CM>, <LENGTH_MM>, <LENGTH_IN>, <LENGTH_PT>, <LENGTH_PC>, <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <TIME_MS>, <TIME_S>, <FREQ_HZ>, <FREQ_KHZ>, <RESOLUTION_DPI>, <RESOLUTION_DPCM>, , , , .)
FAILED: verify
org.openqa.selenium.ElementNotVisibleException: You may only interact with visible elements
Build info: version: '2.46.0', revision: '87c69e2', time: '2015-06-04 16:16:47'
System info: host: 'SS01-NBK-035', ip: '10.1.18.37', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_51'
Driver info: driver.version: unknown
at org.openqa.selenium.htmlunit.HtmlUnitWebElement.verifyCanInteractWithElement(HtmlUnitWebElement.java:280)
at org.openqa.selenium.htmlunit.HtmlUnitWebElement.click(HtmlUnitWebElement.java:138)
at test1.phantomTest.verify(phantomTest.java:68)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
at org.testng.SuiteRunner.run(SuiteRunner.java:240)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:230)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:76)
===============================================
Default test
Tests run: 1, Failures: 1, Skips: 0
===============================================
Default suite
Total tests run: 1, Failures: 1, Skips: 0
[TestNG] Time taken by org.testng.reporters.XMLReporter@28864e92: 16 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter2@1888ff2c: 7 ms
[TestNG] Time taken by org.testng.reporters.jq.Main@7cdbc5d3: 42 ms
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@33a10788: 46 ms
[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@357246de: 6 ms
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 8 ms
Please suggest a solution or a way around.
The text was updated successfully, but these errors were encountered: