wakaleo on master
display URL in REST query repor… (compare)
java -Dcucumber.filter.tags=@app -Dcucumber.features=classpath:features -Dcucumber.glue=classpath:demo.stepdefinitions -Dwebdriver.driver=appium -Dappium.screenshots.dir=$DEVICEFARM_SCREENSHOT_PATH -Dappium.autoAcceptAlerts=true -Dappium.platformName=iOS -Dappium.app=$DEVICEFARM_APP_PATH org.testng.TestNG -junit -testjar *-tests.jar -d $DEVICEFARM_LOG_DIR/test-output -verbose 10
Hi - I am trying to get a RemoteWebDriver session to launch a new session on PerfectoMobile cloud and I keep getting error message as "Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.". I checked the URLs, security info and other capabilities and everything looks fine.. Appreciate if you can assist.. Pasting the ProviderClass details here:
import java.net.URL;
import java.util.Iterator;
import org.openqa.selenium.Platform;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import net.thucydides.core.util.EnvironmentVariables;
import net.thucydides.core.util.SystemEnvironmentVariables;
import net.thucydides.core.webdriver.DriverSource;
public class PerfectoSerenityDriver implements DriverSource {
@Override
public WebDriver newDriver() {
System.out.println("Initiating perfecto driver");
EnvironmentVariables environmentVariables = SystemEnvironmentVariables.createEnvironmentVariables();
try {
DesiredCapabilities capabilities = new DesiredCapabilities("chrome", "", Platform.ANY);
String host = "xxx.perfectomobile.com";
String token = "test token code replaced with actual key";
capabilities.setCapability("securityToken", token);
capabilities.setCapability("platformName", "Windows");
capabilities.setCapability("platformVersion", "10");
capabilities.setCapability("browserName", "chrome");
capabilities.setCapability("browserVersion", "87");
capabilities.setCapability("location", "US East");
capabilities.setCapability("resolution", "1280x1024");
System.out.println("Capabilities set: " + capabilities);
WebDriver driver = new RemoteWebDriver(new URL("https://" + host + "/nexperience/perfectomobile/wd/hub/fast"), capabilities);
System.out.println("driver got initiated");
return driver;
}
catch(Exception e){
System.out.println("Problem initiating remote web session " + e.getMessage());
return null;
}
}
@Override
public boolean takesScreenshots() {
return true;
}
}
Error exception:
Problem initiating remote web session Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'xxxxxxx', ip: 'yyyyyyy', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_191'
Driver info: driver.version: PerfectoSerenityDriver
Given User login into SFDC as ADMIN # starter.stepdefinitions.commonStepDefination.user_login_into_SFDC_as_ADMIN()
net.serenitybdd.core.exceptions.SerenityManagedException
at org.junit.Assert.fail(Assert.java:86)
at org.junit.Assert.fail(Assert.java:95)
at wfm_PageObjects.LoginPage.loginSalesforce(LoginPage.java:60)
at wfm_PageObjects.LoginPage$ByteBuddy$wm46uLWS.loginSalesforce$accessor$v6mXo8Ji(Unknown Source)
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 net.thucydides.core.steps.BaseMethodRunner.invokeMethod(BaseMethodRunner.java:18)
at net.thucydides.core.steps.NormalMethodRunner.invokeMethodAndNotifyFailures(NormalMethodRunner.java:18)
at net.thucydides.core.steps.StepInterceptor.runNormalMethod(StepInterceptor.java:394)
at net.thucydides.core.steps.StepInterceptor.testStepResult(StepInterceptor.java:179)
at net.thucydides.core.steps.StepInterceptor.intercept(StepInterceptor.java:77)
at wfm_PageObjects.LoginPage$ByteBuddy$wm46uLWS.loginSalesforce(Unknown Source)
at starter.stepdefinitions.commonStepDefination.user_login_into_SFDC_as_ADMIN(commonStepDefination.java:48)
Hi - I am trying to get a RemoteWebDriver session to launch a new session on PerfectoMobile cloud and I keep getting error message as "Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.". I checked the URLs, security info and other capabilities and everything looks fine.. Appreciate if you can assist.. Pasting the ProviderClass details here:
import java.net.URL;
import java.util.Iterator;import org.openqa.selenium.Platform;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;import net.thucydides.core.util.EnvironmentVariables;
import net.thucydides.core.util.SystemEnvironmentVariables;
import net.thucydides.core.webdriver.DriverSource;public class PerfectoSerenityDriver implements DriverSource {
@Override public WebDriver newDriver() { System.out.println("Initiating perfecto driver"); EnvironmentVariables environmentVariables = SystemEnvironmentVariables.createEnvironmentVariables(); try { DesiredCapabilities capabilities = new DesiredCapabilities("chrome", "", Platform.ANY); String host = "xxx.perfectomobile.com"; String token = "test token code replaced with actual key"; capabilities.setCapability("securityToken", token); capabilities.setCapability("platformName", "Windows"); capabilities.setCapability("platformVersion", "10"); capabilities.setCapability("browserName", "chrome"); capabilities.setCapability("browserVersion", "87"); capabilities.setCapability("location", "US East"); capabilities.setCapability("resolution", "1280x1024"); System.out.println("Capabilities set: " + capabilities); WebDriver driver = new RemoteWebDriver(new URL("https://" + host + "/nexperience/perfectomobile/wd/hub/fast"), capabilities); System.out.println("driver got initiated"); return driver; } catch(Exception e){ System.out.println("Problem initiating remote web session " + e.getMessage()); return null; } } @Override
public boolean takesScreenshots() {
return true;
}
}Error exception:
Problem initiating remote web session Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'xxxxxxx', ip: 'yyyyyyy', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_191'
Driver info: driver.version: PerfectoSerenityDriver
Given User login into SFDC as ADMIN # starter.stepdefinitions.commonStepDefination.user_login_into_SFDC_as_ADMIN()
net.serenitybdd.core.exceptions.SerenityManagedException
at org.junit.Assert.fail(Assert.java:86)
at org.junit.Assert.fail(Assert.java:95)
at wfm_PageObjects.LoginPage.loginSalesforce(LoginPage.java:60)
at wfm_PageObjects.LoginPage$ByteBuddy$wm46uLWS.loginSalesforce$accessor$v6mXo8Ji(Unknown Source)
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 net.thucydides.core.steps.BaseMethodRunner.invokeMethod(BaseMethodRunner.java:18)
at net.thucydides.core.steps.NormalMethodRunner.invokeMethodAndNotifyFailures(NormalMethodRunner.java:18)
at net.thucydides.core.steps.StepInterceptor.runNormalMethod(StepInterceptor.java:394)
at net.thucydides.core.steps.StepInterceptor.testStepResult(StepInterceptor.java:179)
at net.thucydides.core.steps.StepInterceptor.intercept(StepInterceptor.java:77)
@wakaleo @globalworming - can you please assist?
java -Dserenity:aggregrate -Dserenity.outputDirectory=target/site/serenity -Dcucumber.filter.tags=@app -Dcucumber.features=classpath:features -Dcucumber.glue=classpath:demo.stepdefinitions -Dwebdriver.driver=appium -Dappium.screenshots.dir=$DEVICEFARM_SCREENSHOT_PATH -Dappium.autoAcceptAlerts=true -Dappium.platformName=$DEVICEFARM_DEVICE_PLATFORM_NAME -Dappium.app=$DEVICEFARM_APP_PATH org.testng.TestNG -junit -testjar *-tests.jar -d $DEVICEFARM_LOG_DIR/test-output -verbose 10
<serenity.version>2.3.10</serenity.version>
<serenity.maven.version>2.3.10</serenity.maven.version>
<serenity.cucumber.version>2.3.10</serenity.cucumber.version>
As well using cucumber 6 with dependency as : <dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-cucumber6</artifactId>
<version>${serenity.cucumber.version}</version>
<scope>test</scope>
</dependency>
However, if i use cucumber 4 and up, Eclipse cant navigate feature to stepdef using F3
on keyboard. And this is a known issue for cucumber 4 and up as https://github.com/cucumber/cucumber-eclipse/issues/372
. Can you please help me which lower compatible cucumber version i can use with those serenity versions. And other dependencies i needed to add? So my eclipse can find step def for cucumber steps.
<serenity.version>2.3.10</serenity.version> <serenity.maven.version>2.3.10</serenity.maven.version> <serenity.cucumber.version>2.3.10</serenity.cucumber.version>
As well using cucumber 6 with dependency as : <dependency> <groupId>net.serenity-bdd</groupId> <artifactId>serenity-cucumber6</artifactId> <version>${serenity.cucumber.version}</version> <scope>test</scope> </dependency>
However, if i use cucumber 4 and up, Eclipse cant navigate feature to stepdef using F3 on keyboard. And this is a known issue for cucumber 4 and up as cucumber/cucumber-eclipse#372 Can you please help me which lower compatible cucumber version i can use with those serenity versions. And other dependencies i needed to add? So my eclipse can find step def for cucumber steps.
Hello All and @globalworming @wakaleo @thePantz -
I have been trying for awhile to launch a session on PerfectoMobile cloud, but I keep getting error at RemoteWebDriver line as "Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure."
If I use the same capabilities in a simple Java class, it is able to launch the remote session on PerfectoMobile cloud.
Can someone please help me where the issue could be?
My pom.xml file has all latest version of serenity and cucumber
serenity.properties file has:
webdriver.driver=provided
webdriver.provided.type=mydriver
webdriver.provided.mydriver=Utility.PerfectoSerenityDriver
serenity.driver.capabilities=mydriver
webdriver.chrome.driver = /usr/bin/google-chrome
in serenity.properties. No success. Any help will be appreciated
Hi..When I upgraded to 2.3.12 , i don't see the colors in the test summary section. In previous versions each line below was colored differently which I felt looked good.
[INFO] SERENITY TESTS : SUCCESS
[INFO] -----------------------------------------
[INFO] | Tests executed | 2
[INFO] | Tests passed | 2
[INFO] | Tests failed | 0
[INFO] | Tests with errors | 0
[INFO] | Tests compromised | 0
[INFO] | Tests pending | 0
[INFO] | Tests ignored/skipped | 0
[INFO] ------------------------ | --------------
[INFO] | Total Duration | 37s 714ms
[INFO] | Fastest test took | 12s 555ms
[INFO] | Slowest test took | 25s 159ms
[INFO] -----------------------------------------
Another more minor issue. Doing it old fashioned way (no screenplay). Feature look like:
Scenario: Illegal syntax entered into search box
And Producing oil & gas fields is the search layer
And he enters "'Cardiff'" into search box
Then he sees error alert message
The step for enter text into searchbox is:
@Step("enter search layer text {0}")
public void searchLayerText(String searchText) {
WebElementFacade searchBox = find(ByAngular.model("mc.query.search.text"));
searchBox.typeAndEnter(searchText);
}
And the step for checking that an alert has happened is:
@Step("Wait for alert")
public Boolean alertPresent() {
try {
waitFor(ExpectedConditions.alertIsPresent());
return true;
} catch (Exception e) {
System.out.println(e.getMessage());
return false;
}
}
This does work, but I notice in logs that I get:
org.openqa.selenium.UnhandledAlertException:
unexpected alert open:
after entering the search text which implies that I need to set up expectation of the alert in advance???