- I am using Spring boot in my project and autowired the driver proivder class and using browser stack, however while running the code the chromedriver is starting but not launching a chrome browser and getting
a below issue.
"Starting ChromeDriver 2.37.544315 (730aa6a5fdba159ac9f4c1e8cbc59bf1b5ce12b7) on port 26833 Only local connections are allowed.
com.mastercard.quality.engineering.mtaf.ui.exceptions.DelegateWebDriverNotFoundException: Delegate WebDriver not found. Please verify that either
You have set a Maven parameter 'default.web.execution.platform' with a valid value.
You have included a meta tag in each JBehave story '@webPlatform' with a valid value
You have included a meta tag for each JBehave scenario '@webPlatform' with a valid value."
Sample Code
@Component
public class LoginSteps extends AbstractSteps {
@Autowired
private DriverProvider webProvider;
Login login;
ConnectHomePage connectHomePage;
MyAppsPage myAppsPage;
@Given("I login in using <USER> and <PASSWORD>")
public void loginInto(@Named("USER") String userName, @Named("PASSWORD") String password) {
try {
if (webProvider.get().getClass().toString().toLowerCase().contains("browserstack")) {
String browserStackUrl = CommonUtils.fetchBrowserStackUrl(webProvider);
String fileContent = "browserstack_url=" + browserStackUrl + "
" + "echo $browserstack_url ";
CommonUtils.generateFileWithContent("browserstack_url.txt", fileContent, null);
}
webProvider.get().manage().window().maximize();
Login = new Login(webProvider.get());
Login.open(env.getProperty("base.url")).acceptConsent().enterUserNameSearch(userName);
Login.waitForMcSpinnerToDisappear();
Login.enterPasswordSearch(password).clickNextButton();
if (System.getProperty("env").equalsIgnoreCase("stage"))
Login.clickContinueButton();
} catch (Exception e) {
LOG.error("Login Failed due to Incorrect Password or is down");
LOG.info(e);
throw new AssertionError("Unable to Login either Incorrect Password or is down ", e);
}
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…