1

I am using the below code to generate accessToken.

import com.eviware.soapui.impl.rest.actions.oauth.OltuOAuth2ClientFacade;
    import com.eviware.soapui.support.editor.inspectors.auth.TokenType;
    import com.eviware.soapui.model.support.ModelSupport;
    
    // Set up variables
    def project = ModelSupport.getModelItemProject(context.getModelItem());
    def authProfile = project.getAuthRepository().getEntry("user");
    def oldToken = authProfile.getAccessToken();
    def tokenType = TokenType.ACCESS;
    //log.info("OLD TOKEN: " + oldToken);
    
    // Create a facade object
    def oAuthFacade = new OltuOAuth2ClientFacade(tokenType);
    
    // Request an access token in headless mode
    oAuthFacade.requestAccessToken(authProfile, true, true);
    
    // Wait until the access token gets updated
    //while(oldToken == authProfile.getAccessToken()) {
    //}
    //The sleep method can be used instead of a while loop
    //sleep(3000);
    
    for(int i = 0; i<=6000; i++){
    if(oldToken != authProfile.getAccessToken()){
    break
    }
    sleep(1)
    }
    
    // Post the info to the log
    def token = authProfile.getAccessToken();
    log.info("NEW TOKEN: " + authProfile.getAccessToken());
    
    testRunner.testCase.testSuite.project.setPropertyValue( "accessToken", token )

This code works without issues in laptop. But when configured in CI/CD pipeline, the code fails with the error message:-

An error occurred [/tmp/JxBrowser/7.12/libbrowsercore_toolkit.so: libX11.so.6: cannot open shared object file: No such file or directory], see error log for details An error occurred in the script of the Groovy Script test step [Groovy Script 3]: [errorlog] java.lang.UnsatisfiedLinkError: /tmp/JxBrowser/7.12/libbrowsercore_toolkit.so: libX11.so.6: cannot open shared object file: No such file or directory java.lang.UnsatisfiedLinkError: /tmp/JxBrowser/7.12/libbrowsercore_toolkit.so: libX11.so.6: cannot open shared object file: No such file or directory

1

It looks like there's a package missing which is required to run Chromium or JX Browser in order to execute your script successfully.

The missing library is libX11.so.6.

You can install this in Debian system with this command,

sudo apt-get install libx11-6 -y

You can also look up other necessary package names by typing the below line in your terminal and then hitting the tab key a couple of times.

sudo apt-get install libx11-

Check the listed packages and then install the once you require.

You can also use this command to install few other packages that might be required,

sudo apt-get install gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget

Then try to execute your code.

For other OS types, you can find the required packages name here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.