sbtqa / page-factory Goto Github PK
View Code? Open in Web Editor NEWJava framework for functional UI test automation in the BDD style
License: Other
Java framework for functional UI test automation in the BDD style
License: Other
Need to impement webdriver.shared option.
This option allow webdriver to stay alive between tests in single run.
Exception in thread "main" java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:592)
at java.lang.Integer.parseInt(Integer.java:615)
at ru.sbtqa.tag.pagefactory.PageFactory.getTimeOutInSeconds(PageFactory.java:121)
at ru.sbtqa.tag.pagefactory.drivers.TagWebDriver.createDriver(TagWebDriver.java:181)
at ru.sbtqa.tag.pagefactory.drivers.TagWebDriver.getDriver(TagWebDriver.java:77)
at Main.main(Main.java:6)
On projects with multiple tests (more than 1000), according to DevOps, it will not be possible to quickly run these tests (previously used for the run of regression tests almost all night). For this reason, I would like to create several instances of a webdriver, and not just one. Was it in the plans (pf-2?)?
Just like in #40
returns element name instead of element title
Now not displayed the test' steps in output
before pagefactory, errror in the test's result was displayed on the first place. Now it is lost in unnecessary log
Sorry for my English =)
Now We have a lot of unnecessary information in some exceptions:
ru.sbtqa.tag.pagefactory.exceptions.FactoryRuntimeException: Failed to invoke method
at ru.sbtqa.tag.pagefactory.Page.executeMethodByTitle(Page.java:855)
at ru.sbtqa.tag.pagefactory.stepdefs.GenericStepDefs.userActionOneParam(GenericStepDefs.java:245)
at ✽.И pagefactory° пользователь (проверяет присутствие продукта) "KARCHER WD 3 Premium1"(YandexMarket.feature:9)
Caused by: java.lang.reflect.InvocationTargetException: null
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.commons.lang3.reflect.MethodUtils.invokeMethod(MethodUtils.java:132)
at org.apache.commons.lang3.reflect.MethodUtils.invokeMethod(MethodUtils.java:97)
at ru.sbtqa.tag.pagefactory.Page.executeMethodByTitle(Page.java:852)
at ru.sbtqa.tag.pagefactory.stepdefs.GenericStepDefs.userActionOneParam(GenericStepDefs.java:245)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at cucumber.runtime.Utils$1.call(Utils.java:40)
at cucumber.runtime.Timeout.timeout(Timeout.java:16)
at cucumber.runtime.Utils.invoke(Utils.java:34)
at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:38)
at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:37)
at cucumber.runtime.Runtime.runStep(Runtime.java:300)
at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44)
at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39)
at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:44)
at cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:102)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:70)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:95)
at ru.sbtqa.tag.cucumber.TagCucumber.runChild(TagCucumber.java:174)
at ru.sbtqa.tag.cucumber.TagCucumber.runChild(TagCucumber.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.api.junit.Cucumber.run(Cucumber.java:100)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
Caused by: java.lang.AssertionError: Продукт KARCHER WD 3 Premium1 не был найден
at org.junit.Assert.fail(Assert.java:88)
at ru.sbtqa.tag.pagefactoryexample.pages.YandexMarket.YmSearchResultsPage.compareProductCost(YmSearchResultsPage.java:30)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.commons.lang3.reflect.MethodUtils.invokeMethod(MethodUtils.java:132)
at org.apache.commons.lang3.reflect.MethodUtils.invokeMethod(MethodUtils.java:97)
at ru.sbtqa.tag.pagefactory.Page.executeMethodByTitle(Page.java:852)
at ru.sbtqa.tag.pagefactory.stepdefs.GenericStepDefs.userActionOneParam(GenericStepDefs.java:245)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at cucumber.runtime.Utils$1.call(Utils.java:40)
at cucumber.runtime.Timeout.timeout(Timeout.java:16)
at cucumber.runtime.Utils.invoke(Utils.java:34)
at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:38)
at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:37)
at cucumber.runtime.Runtime.runStep(Runtime.java:300)
at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44)
at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39)
at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:44)
at cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:102)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:70)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:95)
at ru.sbtqa.tag.cucumber.TagCucumber.runChild(TagCucumber.java:174)
at ru.sbtqa.tag.cucumber.TagCucumber.runChild(TagCucumber.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.api.junit.Cucumber.run(Cucumber.java:100)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
So we should pull up main caused by and strip all that in before and produce this instead:
java.lang.AssertionError: Продукт KARCHER WD 3 Premium1 не был найден
at org.junit.Assert.fail(Assert.java:88)
at ru.sbtqa.tag.pagefactoryexample.pages.YandexMarket.YmSearchResultsPage.compareProductCost(YmSearchResultsPage.java:30)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.commons.lang3.reflect.MethodUtils.invokeMethod(MethodUtils.java:132)
at org.apache.commons.lang3.reflect.MethodUtils.invokeMethod(MethodUtils.java:97)
at ru.sbtqa.tag.pagefactory.Page.executeMethodByTitle(Page.java:852)
at ru.sbtqa.tag.pagefactory.stepdefs.GenericStepDefs.userActionOneParam(GenericStepDefs.java:245)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at cucumber.runtime.Utils$1.call(Utils.java:40)
at cucumber.runtime.Timeout.timeout(Timeout.java:16)
at cucumber.runtime.Utils.invoke(Utils.java:34)
at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:38)
at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:37)
at cucumber.runtime.Runtime.runStep(Runtime.java:300)
at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44)
at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39)
at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:44)
at cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:102)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63)
at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:70)
at cucumber.api.junit.Cucumber.runChild(Cucumber.java:95)
at ru.sbtqa.tag.cucumber.TagCucumber.runChild(TagCucumber.java:174)
at ru.sbtqa.tag.cucumber.TagCucumber.runChild(TagCucumber.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at cucumber.api.junit.Cucumber.run(Cucumber.java:100)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
ru.sbtqa.tag.pagefactory.openPage=^(?:пользователь |он |)(?:находится на странице|открывается страница|открывается вкладка мастера) "([^\"]*)"$
This regexp matches to strange step like this: пользователь|он открывается страница ...
Class: TagWebDriver
Line 134: webDriver.manage().window().maximize();
Кучу дефектов в интернете что так он будет падать, если еще не было перехода по URL.
(и он таки падает)
Рекомендуемый способ максимайза для хром:
ChromeOptions chromeOptions = new ChromeOptions();
chromeOptions.addArguments("--start-maximized");
driver = new ChromeDriver(chromeOptions);
In russian localization we have spelling errors:
ru.sbtqa.tag.pagefactory.userActionTwoParams=^(?:пользователь |он |)\\((.*?)\\) (?:с параметрарми |)\"([^\"]*)\" \"([^\"]*)\"$
ru.sbtqa.tag.pagefactory.userActionThreeParams=^(?:пользователь |он |)\\((.*?)\\) (?:с параметрарми |)\"([^\"]*)\" \"([^\"]*)\" \"([^\"]*)\"$
Should be "параметрами" but now "параметрарми"
Now we can disable aspects only through the method setAspectsDisabled(). I think we should add new property to application.properties for work with it.
Now we support htlmelements by yandex, but we can't use default page actions in blocks.
Add support this funtionality.
java.lang.IllegalStateException: The path to the driver executable must be set by the webdriver.ie.driver system property; for more information, see https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver. The latest version can be downloaded from http://selenium-release.storage.googleapis.com/index.html
at com.google.common.base.Preconditions.checkState(Preconditions.java:197)
at org.openqa.selenium.remote.service.DriverService.findExecutable(DriverService.java:109)
at org.openqa.selenium.ie.InternetExplorerDriverService.access$000(InternetExplorerDriverService.java:32)
at org.openqa.selenium.ie.InternetExplorerDriverService$Builder.findDefaultExecutable(InternetExplorerDriverService.java:167)
at org.openqa.selenium.remote.service.DriverService$Builder.build(DriverService.java:296)
at org.openqa.selenium.ie.InternetExplorerDriver.setupService(InternetExplorerDriver.java:251)
at org.openqa.selenium.ie.InternetExplorerDriver.(InternetExplorerDriver.java:172)
at org.openqa.selenium.ie.InternetExplorerDriver.(InternetExplorerDriver.java:150)
at ru.sbtqa.tag.pagefactory.drivers.TagWebDriver.createDriver(TagWebDriver.java:143)
at ru.sbtqa.tag.pagefactory.drivers.TagWebDriver.getDriver(TagWebDriver.java:106)
at ru.sbtqa.tag.pagefactory.PageFactory.getDriver(PageFactory.java:49)
at ru.sbtqa.tag.pagefactory.PageFactory.getWebDriver(PageFactory.java:39)
at ru.sbt.qa.selenium.react.stepdefs.impl.CommonStepsImpl.(CommonStepsImpl.java:24)
at ru.sbt.qa.selenium.react.stepdefs.base.StepDefsBase.getCommonSteps(StepDefsBase.java:20)
at ru.sbt.qa.sanctions.ui.stepdefs.AuthorizationStepDefs.authorizedInSystem(AuthorizationStepDefs.java:16)
at ?.* пользователь авторизован в системе(1812.feature:5)
It seems that this is due to private static WebDriver webDriver;
ru.sbtqa.tag.pagefactory.exceptions.FactoryRuntimeException: Failed to invoke method at ru.sbtqa.tag.pagefactory.Page.executeMethodByTitle(Page.java:860) at ru.sbtqa.tag.pagefactory.stepdefs.GenericStepDefs.userActionTwoParams(GenericStepDefs.java:260) at ✽.* user (fill the field) "email" "[email protected]"(landing.feature:9) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.apache.commons.lang3.reflect.MethodUtils.invokeMethod(MethodUtils.java:132) at org.apache.commons.lang3.reflect.MethodUtils.invokeMethod(MethodUtils.java:97) at ru.sbtqa.tag.pagefactory.Page.executeMethodByTitle(Page.java:857) at ru.sbtqa.tag.pagefactory.stepdefs.GenericStepDefs.userActionTwoParams(GenericStepDefs.java:260) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at cucumber.runtime.Utils$1.call(Utils.java:40) at cucumber.runtime.Timeout.timeout(Timeout.java:16) at cucumber.runtime.Utils.invoke(Utils.java:34) at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:38) at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:37) at cucumber.runtime.Runtime.runStep(Runtime.java:300) at cucumber.runtime.model.StepContainer.runStep(StepContainer.java:44) at cucumber.runtime.model.StepContainer.runSteps(StepContainer.java:39) at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:44) at cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:102) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at cucumber.runtime.junit.ExamplesRunner.run(ExamplesRunner.java:59) at org.junit.runners.Suite.runChild(Suite.java:128) at org.junit.runners.Suite.runChild(Suite.java:27) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at cucumber.runtime.junit.ScenarioOutlineRunner.run(ScenarioOutlineRunner.java:53) at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63) at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:70) at cucumber.api.junit.Cucumber.runChild(Cucumber.java:95) at ru.sbtqa.tag.cucumber.TagCucumber.runChild(TagCucumber.java:106) at ru.sbtqa.tag.cucumber.TagCucumber.runChild(TagCucumber.java:38) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at cucumber.api.junit.Cucumber.run(Cucumber.java:100) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283) at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103) Caused by: org.openqa.selenium.remote.SessionNotFoundException: Session ID is null. Using WebDriver after calling quit()? Build info: version: '2.53.1', revision: 'a36b8b1cd5757287168e54b817830adce9b0158d', time: '2016-06-30 19:26:09' System info: host: 'sbt-ovb-ll001', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-53-generic', java.version: '1.8.0_121' Driver info: driver.version: RemoteWebDriver at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:134) at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:644) at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:363) at org.openqa.selenium.remote.RemoteWebDriver.findElementById(RemoteWebDriver.java:413) at org.openqa.selenium.By$ById.findElement(By.java:218) at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:355) at org.openqa.selenium.support.pagefactory.DefaultElementLocator.findElement(DefaultElementLocator.java:69) at org.openqa.selenium.support.pagefactory.internal.LocatingElementHandler.invoke(LocatingElementHandler.java:38) at com.sun.proxy.$Proxy16.click(Unknown Source) at ru.sbtqa.tag.pagefactory.Page.click_aroundBody0(Page.java:76) at ru.sbtqa.tag.pagefactory.Page$AjcClosure1.run(Page.java:1) at org.aspectj.runtime.reflect.JoinPointImpl.proceed(JoinPointImpl.java:149) at ru.sbtqa.tag.pagefactory.aspects.ClickAspect.doAroundClick(ClickAspect.java:76) at ru.sbtqa.tag.pagefactory.Page.fillField(Page.java:76) ... 66 more
It seems that option tasks.to.kill will not work in unix systems:
if (!WEBDRIVER_PATH.isEmpty()) {
File chromeDriver = new File(WEBDRIVER_PATH + "chromedriver.exe");
System.setProperty("webdriver.chrome.driver", chromeDriver.getAbsolutePath());
} else {
LOG.warn("The value of property 'webdriver.drivers.path is not specified."
+ " Try to get {} driver from system PATH'", WEBDRIVER_BROWSER_NAME);
}
TypifiedElement now implements WebElement, so there is no need to keep different methods for them. Some of the Page methods should be refactored
It should be deprecated because it is being used in a very ugly manner. F.e. clickLink()
:
webElement = PageFactory.getInstance().getCurrentPage().getElementByTitle(elementTitle);
webElement.click();
Core.addToReport(webElement, " is clicked");
and then in addToReport()
:
String elementTitle = PageFactory.getInstance().getCurrentPage().getElementTitle(webElement);
There is duplication steps problem when using page-factory and swing-back together.
Caused by: java.nio.file.FileSystemNotFoundException
at com.sun.nio.zipfs.ZipFileSystemProvider.getFileSystem(ZipFileSystemProvider.java:171)
at com.sun.nio.zipfs.ZipFileSystemProvider.getPath(ZipFileSystemProvider.java:157)
at java.nio.file.Paths.get(Paths.java:143)
at ru.sbtqa.tag.pagefactory.drivers.TagWebDriver.getResourceJsonFileAsJsonObject(TagWebDriver.java:260)
at ru.sbtqa.tag.pagefactory.drivers.TagWebDriver.parseDriverVersionFromMapping(TagWebDriver.java:246)
at ru.sbtqa.tag.pagefactory.drivers.TagWebDriver.configureWebDriverManagerVersion(TagWebDriver.java:22)
at ru.sbtqa.tag.pagefactory.drivers.TagWebDriver.configureWebDriverManagerParams(TagWebDriver.java:19)
at ru.sbtqa.tag.pagefactory.drivers.TagWebDriver.configureDriver(TagWebDriver.java:177)
at ru.sbtqa.tag.pagefactory.drivers.TagWebDriver.createDriver(TagWebDriver.java:140)
at ru.sbtqa.tag.pagefactory.drivers.TagWebDriver.getDriver(TagWebDriver.java:110)
at ru.sbtqa.tag.pagefactory.PageFactory.getDriver(PageFactory.java:49)
at ru.sbt.ufsui.webdriver.page.AuthorizationPage.(AuthorizationPage.java:51)
... 46 more
page-factory:1.7.1
Support options which disable chrome info message:
profile.default_content_setting_values.notifications
Need to put several classes with common step definitions:
Maybe this should even be a separate package, not sure
Generate classes for all language then we have before build
This ability allows you control the moment when initial web page will be opened.
In this way we can easily construct tests which consist of several parts (swing, web, rest).
Ex:
Also we will be able to move the http-auth logic from createWebDriver to new step.
When I create a step "@Когда("^открывается страница "(.?)" и ожидает элемент "(.?)"$")" in my stepdefinitions and used in feature:
ru.sbtqa.tag.qautils.errors.AutotestError: Page object with title 'Стартовый менеджер" и ожидает элемент "Поиск по каталогу' is not registered
at ru.sbtqa.tag.pagefactory.PageWrapper.getPage(PageWrapper.java:54)
at ru.sbtqa.tag.pagefactory.stepdefs.GenericStepDefs.openPage(GenericStepDefs.java:218)
If we are using page-factory and api-factory in the shared project, and we have only api feature, webdriver shouldnot initialize in this case
Now in some methods we have binding to specific languages, we should do it like in steps
try to use http://stackoverflow.com/a/39074627
Cause there is no nullification of mobileDriver variable in TagMobileDriver.dispose().
VideoRecorder constructor assumes that video.path.dest property is mandatory.
So if it is not defined then error occured in page-factory SetupStepDefs.tearDown() method while trying to getInstance()
I recently faced the problem when I couldn't use method findElementByTitleInBlock(blockName, elementTitle) because inside it uses findElementInBlock() which checks all fields in given block and then checks fields type, BUT it compares them using field.getType().equals(type). By default 'type' considered to be WebElement so it leads us to the problem when block's fields declared as TypifiedElement because of strict comparsion of classes.
I guess we may use isAssignableFrom() method instead of equals() which allows fields to be subclasses of 'type'
Class: Page
Line 1044: found.addAll(findBlocks(blockPath, currentField.get(context), returnFirstFound));
Перед рекурсией надо вставить currentField.setAccessible(true);
иначе падает с ошибкой IllegalAccessException
Hello!
I just started to work with page-factory.
When I run page-factory-example I get an error:
FactoryRuntimeException:
Error while executing action 'проверяет присутствие продукта' on YmSearchResultsPage . See the caused exception below
This caused by:
ru.sbtqa.tag.pagefactoryexample.pages.YandexMarket.YmSearchResultsPage.compareProductCost(YmSearchResultsPage.java:46)
Assert.fail("Продукт " + productName + " не был найден");
From:
ru.sbtqa.tag.pagefactory.Page.executeMethodByTitle(Page.java:856)
at
} catch (NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
The reason is that the reflection layer wraps any exception in an InvocationTargetException(following the case we originally got just new AssertionError(message) from Assert).
As I said I'm just day 0 with a project and maybe misunderstood something. But I think it will be a good idea just to unwrap the exception in ru.sbtqa.tag.pagefactory.Page.executeMethodByTitle and check the original one and pass it to Allure in case of Assertion.
Allure 2 is very usefull framework and we need to use it in our project.
Please, implement support of this fremework to Page-factory.
Thank you.
For testing will be comfortable if after creating pull request we will create snapshot in nexus.
Need to use get element by field
I always have exception in this method:
public void executeMethodByTitleInBlock(String blockPath, String actionTitle, Object... parameters)
I think its because in this method using break but should be return
Download - method should download file to directory, maybe it's help https://blog.codecentric.de/en/2010/07/file-downloads-with-selenium-mission-impossible/
Upload - load file to application
If it possible, add this two method.
We need to store all i18n'ed strings in resource bundles and do nod duplicate it in code.
Данное сокращение листинга ошибки применяется только в одном методе executeMethodByTitle во всем фреймворке, может есть смысл убрать его?
Class DesiredCapabilitiesParsaer can't parse my properties because I have a property line equals "webdriver.ie.capability.nativeEvents" but TagWebdriver.getBrowserName() always return a full name of Internet Explorer "internet explorer".
And then I getting "webdriver.internet explorer.capability.someCapability" it fail my parse process.
Now video recorder is commented. Need to uncomment and adapt it
Now if we want to use element in block, this element should have @name annotation, but by default in PageFactory framework we are using @ElementTitle. We need to support this annotation in framework
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.