Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to perform UI automation from the Spring boot project's jar file with CLI? #1510

Closed
ghost opened this issue Mar 9, 2021 · 2 comments
Labels

Comments

@ghost
Copy link

ghost commented Mar 9, 2021

Hi, this is to get my UI test scripts work with the help of jars using CLI. API tests are working fine but in case of UI tests it's not able to hit URL after opening the browser window. Hence it fails at the * driver 'https//:github.com/login' step with the error: 13:41:55.695 driver config / start failed: failed to construct class by name: karate-http.properties not found, aborting, options: {type=chrome, target=null}.

Tried configuring driver and looked for the possibilities. But nothing worked as of now. With * configure driver = { type: 'chrome' } it's opening the browser and not hitting the URL and with any other driver configuration the jars fail to execute and not even the browser is opened up.

Here, will be sharing the code and the framework with the steps. Desperately looking for the help.
jar creation --> pom.xml --> mvn clean install
command to run jars from CLI --> java -jar .jar
once the server starts --> command in URL bar of chrome browser --> http://localhost:8070/initiateKarateTest?tagName=SmokeTest
Test should start in the CLI and UI tests should run with driver instances and report generation in automatically created target folder where the jar files are placed.

Looking forward to some working solution in this regards. Thanks in advance.

automationFramework-master.zip

@ptrthomas
Copy link
Member

@Shobhit1515 I'm sorry, this does not fit our definition of a simple example at all, so I'm closing this issue. anyone monitoring the project feed is welcome to jump in with suggestions - or you can continue to try your luck on stack-overflow, open a new question if needed, and keep it simple and focused

one of the reasons is that trying to build your custom JAR is tricky and we had a lot of issues with it in the past, see this thread: #751

on top of that it sounds like you want to run UI tests like this, which multiplies the complexity 10x

all this is something we do not recommend or support - so if you want to do it - you are on your own. peace

@ghost
Copy link
Author

ghost commented Mar 9, 2021

As I've tried making problem statement bit specific to the driver configuration and CLI runs. I respect your concerns and let's not talk of jars. But anything which you would've thought could be a source of error in my case would have given me a direction of taking my work forward and explore more possibilities. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant