Gatling Script is throwing a warning: "imported `Login' is permanently hidden by definition of object Login in package actions" - scala

I have encountered an issue while running my Gatling Script in IntelliJ.
I have multiple scripts to be executed, that involve a login to be executed once, and then the rest of the scripts/flows.
Everything was running fine for the first 4-5 scripts, until I encountered this warning -> " imported Login' is permanently hidden by definition of object Login in package actions" in the newly created script. Ever since, every script, that includes even the previously running scripts, has started throwing this warning. As a result, even if I ignore and go ahead with executing the script, it stops moving ahead and remains stuck, later throwing this blockage in the console as well -> importedLogin' is permanently hidden by definition of object Login in package actions.
I have followed exactly the same scripting practice that I have been doing for the earlier scripts with no deviation from the usual.
Flow:
Execute Login
Capture the session id generated during login action.
Create a new script and import the Login action in that script, thereby using the captured session id value.
The problem arises when I import the Login action packages in my new script, as I start seeing the exception in my newly created script only.
Please help.
Thanks!
//Login Action that is being imported to another action below:
package jda.Scheduler.actions
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import scala.concurrent.duration._
object Login {
def loginAction(): ChainBuilder = {
group("Login") {
exec(http("Main_Request")
.post("/******/****/login?loginName=c***&password=****")
.header("Accept", "application/json")
.header("Content-Type", "application/x-www-form-urlencoded")
.header("Accept-Encoding", "gzip")
.header("User-Agent", "okhttp/2.7.5")
.body(StringBody(""""""))
.check(status.in(200))
.check(headerRegex("Set-Cookie", "REFSSessionID(.+?);").find.saveAs("SessionID")))
}
}
}
//Different Action where Login is being imported and issues faced:
package jda.Scheduler.actions
import jda.Scheduler.actions.Login ---> Warning appears (imported 'Login' is permanently hidden by definition of object Login in package actions)
import jda.Scheduler.actions.CreateUserAction ---> Warning appears (imported 'CreateUserAction' is permanently hidden by definition of object CreateUserAction in package actions)
import io.gatling.core.Predef._
import io.gatling.http.Predef._
import scala.concurrent.duration._
object UpdateEmployeeAction {
def updateEmployeeAction(): ChainBuilder = {
group ("updateEmployee"){
exec(http("Main_Request")
.get("/******/****/****/api/***-***/employees/${userID}")
.header("Content-Type", "application/json")
.header("REFSSessionID", "${SessionID}") ---> This part is being captured and saved //in Login action
.body(StringBody("""{
"id": ${userID}, --> This part (${userID}) is being captured and saved in another action, just //like Login Action. Even this is creating same issues.
"badgeNumber": ${userloginname},
"birthDate": "1900-07-31T00:00:00",
"hireDate": "2019-08-12T00:00:00",
"seniorityDate": "2019-08-12T00:00:00",
"minorStatus": "Minor",
"isManagement": false,
"managerPassword": null,
"managerInSchedule": false,
"generateException": true,
"generateAlerts": true,
"canWorkUnassignedJobs": true,
"schedulingTypeCode": "Manual",
"ignoreBiometricValidation": false,
"punchValidationCode": "NoScheduleValidation"
}"""))
.check(status.in(200))
)}}
}

Related

find_element_by_id/name not working as expected

I'm writing some code to try to open strava.com and log me in.
from selenium import webdriver
# create a new Chrome webdriver
driver = webdriver.Chrome()
# navigate to the Strava login page
driver.get('https://www.strava.com/login')
# import the time module
import time
time.sleep(3)
# enter your email address and password
email_field = driver.find_element_by_id('email')
email_field.send_keys('Email')
password_field = driver.find_element_by_id('password')
password_field.send_keys('Password')
# click the "Log In" button to log in
login_button = driver.find_element_by_id('login-button')
login_button.click()
# navigate to the explore page
driver.get('https://www.strava.com/explore')
and I get the following error after strava opens and the script ends abruptly.
email_field = driver.find_element_by_id('email')
AttributeError: 'WebDriver' object has no attribute 'find_element_by_id'
Any ideas?
I've tried to find ways to fix the element but am very new to scripting. I can't seem to make it work and log me into strava.

h is not defined error while running test cases in preact

I have a preact application which uses #testing-library/preact library for test cases. When I try to run a test for a component it throws an error stating that h is not defined. The app works without the import statement in the components but the test cases doesn't work. I get the it is required for converting jsx to h() calls. But is there any way to avoid it so that I don't have to import it in every component in the app ? PS: I tried to configure babel with this plugic babel-plugin-jsx-pragmatic for automatic import but it didn't work. This is my .babelrc file.
{
"plugins": [
["plugin-transform-react-jsx", {
"runtime": "automatic",
"importSource": "preact"
}]
]
}

ModuleNotFoundError:No module name 'odoo.addons,base.res'

I got above error when I try to run the next code
from odoo import models, fields, api
from odoo.exceptions import ValidationError
from odoo.addons.base.res.res_request import referenceable_models
Because there is no res name module present in base module thats why it is giving an error

Vue import failing

I've created a vue application scaffolded from the vue cli. Almost everything is reacting as expected with my app except for an issue with import.
The following works fine:
import Vuex from 'vuex';
but, this throws errors:
import { VuetronVue, VuetronVuex } from 'vuetron';
vue.use(VuetronVue);
Linting error:
"export 'VuetronVue' was not found in 'vuetron'
and Console error:
Uncaught TypeError: Cannot read property 'install' of undefined
Changing the code to:
import vuetron from 'vuetron'
vue.use(vuetron.VuetronVue);
resolves the issue...
This original code was taken directly from the Vuetron documentation. Does anyone have a suggestion as to why the ES6 notation would cause an issue?
This seems to be because
vuetron/packages/vuetron-plugins/index.js
only exports the default object:
import VuetronVue from './vuetron-vue';
import VuetronVuex from './vuetron-vuex';
export default {
VuetronVue,
VuetronVuex
};
For named imports as stated in the docs you would need a named export.

Extending bokeh with coffeescript: fails to import libraries

I'm trying to add to a back end project a special bokeh chart. I used this link to do that. Now I have custom.py file:
from bokeh.models import Renderer
from bokeh.util.compiler import FromFile
class CustomRenderer(Renderer):
__implementation__ = FromFile("path_to_file/custom.coffee")
print __implementation__.code
...
and custom.coffee file:
import {Renderer, RendererView} from "models/renderers/renderer"
...
When I launch bokeh server - a page opens in browser with '500: Internal Server Error'. And I don't know why that happens.
Thanks for any help!