Jibri is unable to record if a moderator sets a meeting password - jitsi

I have setup a jibri using docker. When I'm trying to record the meeting after setting a meeting password then I'm getting a message Recording is stopped and when I checked the logs I found that the jibri user is unable to bypass the meeting password.
snippet of jibri logs
Not joined yet: Cannot read property 'isJoined' of undefined
complete jibri container logs
inalize script 2020-08-19 18:05:51.883 FINE: [71] org.jitsi.xmpp.mucclient.MucClient.log() Received an IQ with type set: IQ Stanza (jibri http://jitsi.org/protocol/jibri) [to=jibri#auth.r.example.in/ERYyDatF,from=jibribrewery#internal-muc.r.example.in/focus,id=amlicmlAYXV0aC5yLmRvY2FkZW5hLmluL0VSWXlEYXRGAFBJdlNrLTE3MADqyFaI3En3qssrxLJFjhPZ,type=set,]
2020-08-19 18:05:51.888 INFO: [71] org.jitsi.jibri.api.xmpp.XmppApi.handleJibriIq() Received JibriIq <iq to='jibri#auth.r.example.in/ERYyDatF' from='jibribrewery#internal-muc.r.example.in/focus' id='amlicmlAYXV0aC5yLmRvY2FkZW5hLmluL0VSWXlEYXRGAFBJdlNrLTE3MADqyFaI3En3qssrxLJFjhPZ' type='set'><jibri xmlns='http://jitsi.org/protocol/jibri' action='start' recording_mode='file' room='test#muc.r.example.in' session_id='ewgvpnxhkrjuiays' app_data='{"file_recording_metadata":{"share":true}}'/></iq> from environment [MucClient id=xmpp.r.example.in hostname=xmpp.r.example.in]
2020-08-19 18:05:51.890 INFO: [71] org.jitsi.jibri.api.xmpp.XmppApi.handleStartJibriIq() Received start request, starting service
2020-08-19 18:05:51.938 INFO: [71] org.jitsi.jibri.api.xmpp.XmppApi.handleStartService() Parsed call url info: CallUrlInfo(baseUrl=https://r.example.in, callName=test, urlParams=[])
2020-08-19 18:05:51.939 INFO: [71] org.jitsi.jibri.JibriManager.startFileRecording() Starting a file recording with params: FileRecordingRequestParams(callParams=CallParams(callUrlInfo=CallUrlInfo(baseUrl=https://r.example.in, callName=test, urlParams=[])), sessionId=ewgvpnxhkrjuiays, callLoginParams=XmppCredentials(domain=recorder.r.example.in, username=recorder, password=46ea1b0e6252479eb6cc647bed7cfc18)) finalize script path: /config/finalize.sh and recordings directory: /config/recording
Starting ChromeDriver 78.0.3904.105 (60e2d8774a8151efa6a00b1f358371b1e0e07ee2-refs/branch-heads/3904#{#877}) on port 13074
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
2020-08-19 18:05:53.109 INFO: [71] org.openqa.selenium.remote.ProtocolHandshake.createSession() Detected dialect: OSS
2020-08-19 18:05:53.131 INFO: [71] org.jitsi.jibri.selenium.JibriSelenium.<init>() Starting empty call check with a timeout of PT30S
2020-08-19 18:05:53.143 FINE: [71] org.jitsi.jibri.capture.ffmpeg.FfmpegCapturer.<init>() Detected os as OS: LINUX
2020-08-19 18:05:53.149 INFO: [71] org.jitsi.jibri.service.impl.FileRecordingJibriService.<init>() Writing recording to /config/recording/ewgvpnxhkrjuiays
2020-08-19 18:05:53.152 FINE: [71] org.jitsi.jibri.statsd.JibriStatsDClient.incrementCounter() Incrementing statsd counter: start:recording
2020-08-19 18:05:53.153 INFO: [71] org.jitsi.jibri.status.JibriStatusManager.log() Busy status has changed: IDLE -> BUSY
2020-08-19 18:05:53.153 INFO: [71] org.jitsi.jibri.api.xmpp.XmppApi.updatePresence() Jibri reports its status is now JibriStatus(busyStatus=BUSY, health=OverallHealth(healthStatus=HEALTHY, details={})), publishing presence to connections
2020-08-19 18:05:53.153 FINE: [71] org.jitsi.xmpp.mucclient.MucClientManager.log() Setting a presence extension: org.jitsi.xmpp.extensions.jibri.JibriStatusPacketExt#15f928f8
2020-08-19 18:05:53.154 FINE: [71] org.jitsi.xmpp.mucclient.MucClientManager.log() Replacing presence extension: org.jitsi.xmpp.extensions.jibri.JibriStatusPacketExt#3935e9a8
2020-08-19 18:05:53.156 INFO: [71] org.jitsi.jibri.api.xmpp.XmppApi.handleStartJibriIq() Sending 'pending' response to start IQ
2020-08-19 18:05:53.161 FINE: [52] org.jitsi.xmpp.extensions.DefaultPacketExtensionProvider.parse() Could not add a provider for element busy-status from namespace http://jitsi.org/protocol/jibri
2020-08-19 18:05:53.161 FINE: [52] org.jitsi.xmpp.extensions.DefaultPacketExtensionProvider.parse() Could not add a provider for element health-status from namespace http://jitsi.org/protocol/health
2020-08-19 18:05:55.313 FINE: [83] org.jitsi.jibri.selenium.pageobjects.CallPage.visit() Visiting url https://r.example.in/test#config.iAmRecorder=true&config.externalConnectUrl=null&config.startWithAudioMuted=true&config.startWithVideoMuted=true&interfaceConfig.APP_NAME="Jibri"&config.analytics.disabled=true&config.p2p.enabled=false&config.prejoinPageEnabled=false&config.requireDisplayName=false
2020-08-19 18:05:56.088 FINE: [83] org.jitsi.jibri.selenium.pageobjects.CallPage.apply() Not joined yet: Cannot read property 'isJoined' of undefined
2020-08-19 18:05:56.608 FINE: [83] org.jitsi.jibri.selenium.pageobjects.CallPage.apply() Not joined yet: Cannot read property 'isJoined' of undefined
2020-08-19 18:06:26.478 SEVERE: [83] org.jitsi.jibri.selenium.pageobjects.CallPage.visit() Timed out waiting for call page to load
2020-08-19 18:06:26.483 INFO: [83] org.jitsi.jibri.selenium.JibriSelenium.onSeleniumStateChange() Transitioning from state Starting up to Error: FailedToJoinCall SESSION Failed to join the call
2020-08-19 18:06:26.485 INFO: [83] org.jitsi.jibri.service.impl.FileRecordingJibriService.onServiceStateChange() File recording service transitioning from state Starting up to Error: FailedToJoinCall SESSION Failed to join the call
2020-08-19 18:06:26.487 INFO: [83] org.jitsi.jibri.api.xmpp.XmppApi.invoke() Current service had an error Error: FailedToJoinCall SESSION Failed to join the call, sending error iq <iq to='jibribrewery#internal-muc.r.example.in/focus' id='HISVW-32' type='set'><jibri xmlns='http://jitsi.org/protocol/jibri' status='off' failure_reason='error' should_retry='true'/></iq>
2020-08-19 18:06:26.488 FINE: [83] org.jitsi.jibri.statsd.JibriStatsDClient.incrementCounter() Incrementing statsd counter: stop:recording
2020-08-19 18:06:26.488 INFO: [83] org.jitsi.jibri.JibriManager.stopService() Stopping the current service
2020-08-19 18:06:26.489 INFO: [83] org.jitsi.jibri.service.impl.FileRecordingJibriService.stop() Stopping capturer
2020-08-19 18:06:26.490 INFO: [83] org.jitsi.jibri.util.JibriSubprocess.ffmpeg.stop() Stopping ffmpeg process
2020-08-19 18:06:26.490 INFO: [83] org.jitsi.jibri.util.JibriSubprocess.ffmpeg.stop() ffmpeg exited with value null
2020-08-19 18:06:26.491 INFO: [83] org.jitsi.jibri.service.impl.FileRecordingJibriService.stop() Quitting selenium
2020-08-19 18:06:26.507 INFO: [83] org.jitsi.jibri.service.impl.FileRecordingJibriService.stop() Participants in this recording: []
2020-08-19 18:06:26.580 INFO: [83] org.jitsi.jibri.selenium.JibriSelenium.leaveCallAndQuitBrowser() Leaving call and quitting browser
2020-08-19 18:06:26.581 INFO: [83] org.jitsi.jibri.selenium.JibriSelenium.leaveCallAndQuitBrowser() Recurring call status checks cancelled
2020-08-19 18:06:26.596 INFO: [83] org.jitsi.jibri.selenium.JibriSelenium.leaveCallAndQuitBrowser() Got 12 log entries for type browser
2020-08-19 18:06:26.668 INFO: [83] org.jitsi.jibri.selenium.JibriSelenium.leaveCallAndQuitBrowser() Got 1086 log entries for type driver
2020-08-19 18:06:26.802 INFO: [83] org.jitsi.jibri.selenium.JibriSelenium.leaveCallAndQuitBrowser() Got 0 log entries for type client
2020-08-19 18:06:26.802 INFO: [83] org.jitsi.jibri.selenium.JibriSelenium.leaveCallAndQuitBrowser() Leaving web call
2020-08-19 18:06:31.850 SEVERE: [83] org.jitsi.jibri.selenium.JibriSelenium.leaveCallAndQuitBrowser() Error trying to leave the call: org.openqa.selenium.JavascriptException: javascript error: The timeout for the confirmation about leaving the room expired.
(Session info: chrome=78.0.3904.97)
(Driver info: chromedriver=78.0.3904.105 (60e2d8774a8151efa6a00b1f358371b1e0e07ee2-refs/branch-heads/3904#{#877}),platform=Linux 4.15.0-111-generic x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: '4a4d5ccd62bb', ip: '172.20.0.6', os.name: 'Linux', os.arch: 'amd64', os.version: '4.15.0-111-generic', java.version: '1.8.0_252'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities {acceptInsecureCerts: false, acceptSslCerts: false, applicationCacheEnabled: false, browserConnectionEnabled: false, browserName: chrome, chrome: {chromedriverVersion: 78.0.3904.105 (60e2d8774a81..., userDataDir: /tmp/.com.google.Chrome.OfQexN}, cssSelectorsEnabled: true, databaseEnabled: false, goog:chromeOptions: {debuggerAddress: localhost:33417}, handlesAlerts: true, hasTouchScreen: false, javascriptEnabled: true, locationContextEnabled: true, mobileEmulationEnabled: false, nativeEvents: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: LINUX, platformName: LINUX, proxy: Proxy(), rotatable: false, setWindowRect: true, strictFileInteractability: false, takesHeapSnapshot: true, takesScreenshot: true, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unexpectedAlertBehaviour: ignore, unhandledPromptBehavior: ignore, version: 78.0.3904.97, webStorageEnabled: true}
Session ID: add424a6f715dda3b7ecc4d8be721d3b with stack:
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
java.lang.reflect.Constructor.newInstance(Constructor.java:423)
org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)
org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)
org.openqa.selenium.remote.http.JsonHttpResponseCodec.reconstructValue(JsonHttpResponseCodec.java:40)
org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:80)
org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:44)
org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543)
org.openqa.selenium.remote.RemoteWebDriver.executeScript(RemoteWebDriver.java:480)
org.jitsi.jibri.selenium.pageobjects.CallPage.leave(CallPage.kt:221)
org.jitsi.jibri.selenium.JibriSelenium.leaveCallAndQuitBrowser(JibriSelenium.kt:299)
org.jitsi.jibri.service.impl.FileRecordingJibriService.stop(FileRecordingJibriService.kt:190)
org.jitsi.jibri.JibriManager.stopService(JibriManager.kt:257)
org.jitsi.jibri.JibriManager$startService$1.invoke(JibriManager.kt:206)
org.jitsi.jibri.JibriManager$startService$1.invoke(JibriManager.kt:84)
org.jitsi.jibri.util.StatusPublisher$addStatusHandler$1.invoke(StatusPublisher.kt:37)
org.jitsi.jibri.util.StatusPublisher$addStatusHandler$1.invoke(StatusPublisher.kt:29)
org.jitsi.jibri.util.StatusPublisher$publishStatus$1.invoke(StatusPublisher.kt:53)
org.jitsi.jibri.util.StatusPublisher$publishStatus$1.invoke(StatusPublisher.kt:29)
kotlin.collections.CollectionsKt__MutableCollectionsKt.filterInPlace$CollectionsKt__MutableCollectionsKt(MutableCollections.kt:293)
kotlin.collections.CollectionsKt__MutableCollectionsKt.retainAll(MutableCollections.kt:284)
org.jitsi.jibri.util.StatusPublisher.publishStatus(StatusPublisher.kt:53)
org.jitsi.jibri.service.impl.StatefulJibriService.onServiceStateChange(StatefulJibriService.kt:40)
org.jitsi.jibri.service.impl.StatefulJibriService.access$onServiceStateChange(StatefulJibriService.kt:26)
org.jitsi.jibri.service.impl.StatefulJibriService$1.invoke(StatefulJibriService.kt:35)
org.jitsi.jibri.service.impl.StatefulJibriService$1.invoke(StatefulJibriService.kt:26)
org.jitsi.jibri.util.NotifyingStateMachine.notify(NotifyingStateMachine.kt:26)
org.jitsi.jibri.service.JibriServiceStateMachine.access$notify(JibriServiceStateMachine.kt:46)
org.jitsi.jibri.service.JibriServiceStateMachine$stateMachine$1$5.invoke(JibriServiceStateMachine.kt:100)
org.jitsi.jibri.service.JibriServiceStateMachine$stateMachine$1$5.invoke(JibriServiceStateMachine.kt:46)
com.tinder.StateMachine.notifyOnTransition(StateMachine.kt:65)
com.tinder.StateMachine.transition(StateMachine.kt:23)
org.jitsi.jibri.service.JibriServiceStateMachine.transition(JibriServiceStateMachine.kt:112)
org.jitsi.jibri.service.impl.StatefulJibriService$registerSubComponent$1.invoke(StatefulJibriService.kt:46)
org.jitsi.jibri.service.impl.StatefulJibriService$registerSubComponent$1.invoke(StatefulJibriService.kt:26)
org.jitsi.jibri.util.StatusPublisher$addStatusHandler$1.invoke(StatusPublisher.kt:37)
org.jitsi.jibri.util.StatusPublisher$addStatusHandler$1.invoke(StatusPublisher.kt:29)
org.jitsi.jibri.util.StatusPublisher$publishStatus$1.invoke(StatusPublisher.kt:53)
org.jitsi.jibri.util.StatusPublisher$publishStatus$1.invoke(StatusPublisher.kt:29)
kotlin.collections.CollectionsKt__MutableCollectionsKt.filterInPlace$CollectionsKt__MutableCollectionsKt(MutableCollections.kt:293)
kotlin.collections.CollectionsKt__MutableCollectionsKt.retainAll(MutableCollections.kt:284)
org.jitsi.jibri.util.StatusPublisher.publishStatus(StatusPublisher.kt:53)
org.jitsi.jibri.selenium.JibriSelenium.onSeleniumStateChange(JibriSelenium.kt:184)
org.jitsi.jibri.selenium.JibriSelenium.access$onSeleniumStateChange(JibriSelenium.kt:116)
org.jitsi.jibri.selenium.JibriSelenium$1.invoke(JibriSelenium.kt:169)
org.jitsi.jibri.selenium.JibriSelenium$1.invoke(JibriSelenium.kt:116)
org.jitsi.jibri.util.NotifyingStateMachine.notify(NotifyingStateMachine.kt:26)
org.jitsi.jibri.selenium.SeleniumStateMachine.access$notify(SeleniumStateMachine.kt:33)
org.jitsi.jibri.selenium.SeleniumStateMachine$stateMachine$1$5.invoke(SeleniumStateMachine.kt:78)
org.jitsi.jibri.selenium.SeleniumStateMachine$stateMachine$1$5.invoke(SeleniumStateMachine.kt:33)
com.tinder.StateMachine.notifyOnTransition(StateMachine.kt:65)
com.tinder.StateMachine.transition(StateMachine.kt:23)
org.jitsi.jibri.selenium.SeleniumStateMachine.transition(SeleniumStateMachine.kt:83)
org.jitsi.jibri.selenium.JibriSelenium$joinCall$1.run(JibriSelenium.kt:260)
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
java.util.concurrent.FutureTask.run(FutureTask.java:266)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
java.lang.Thread.run(Thread.java:748)
2020-08-19 18:06:31.850 INFO: [83] org.jitsi.jibri.selenium.JibriSelenium.leaveCallAndQuitBrowser() Quitting chrome driver
2020-08-19 18:06:31.932 INFO: [83] org.jitsi.jibri.selenium.JibriSelenium.leaveCallAndQuitBrowser() Chrome driver quit
2020-08-19 18:06:31.933 INFO: [83] org.jitsi.jibri.service.impl.FileRecordingJibriService.stop() Finalizing the recording
2020-08-19 18:06:41.949 SEVERE: [83] org.jitsi.jibri.service.impl.FileRecordingJibriService.finalize() Timed out waiting for process logger task to complete
2020-08-19 18:06:41.949 INFO: [83] org.jitsi.jibri.service.impl.FileRecordingJibriService.finalize() Recording finalize script finished with exit value 0
2020-08-19 18:06:41.951 INFO: [83] org.jitsi.jibri.status.JibriStatusManager.log() Busy status has changed: BUSY -> IDLE
2020-08-19 18:06:41.951 INFO: [83] org.jitsi.jibri.api.xmpp.XmppApi.updatePresence() Jibri reports its status is now JibriStatus(busyStatus=IDLE, health=OverallHealth(healthStatus=HEALTHY, details={})), publishing presence to connections
2020-08-19 18:06:41.952 FINE: [83] org.jitsi.xmpp.mucclient.MucClientManager.log() Setting a presence extension: org.jitsi.xmpp.extensions.jibri.JibriStatusPacketExt#1d998819
2020-08-19 18:06:41.953 FINE: [83] org.jitsi.xmpp.mucclient.MucClientManager.log() Replacing presence extension: org.jitsi.xmpp.extensions.jibri.JibriStatusPacketExt#15f928f8
2020-08-19 18:06:41.959 FINE: [52] org.jitsi.xmpp.extensions.DefaultPacketExtensionProvider.parse() Could not add a provider for element busy-status from namespace http://jitsi.org/protocol/jibri
2020-08-19 18:06:41.959 FINE: [52] org.jitsi.xmpp.extensions.DefaultPacketExtensionProvider.parse() Could not add a provider for element health-status from namespace http://jitsi.org/protocol/health
Please help.

You need to use an external script to allow jibri user to bypass the meeting password. There's already a bug opened in jitsi-docker github repository. Below is snippet of script mentioned in that bug.
local MUC_NS = "http://jabber.org/protocol/muc";
local jid = require "util.jid";
local pre_jibri_user = os.getenv("JIBRI_RECORDER_USER")
local pre_jibri_domain = os.getenv("XMPP_RECORDER_DOMAIN")
module:hook("muc-occupant-pre-join", function (event)
local room, stanza = event.room, event.stanza;
local user, domain, res = jid.split(event.stanza.attr.from);
log("info", "--------------> user %s domain %s res %s pass %s", tostring(user),tostring(domain),tostring(res),tostring(room:get_password()));
if ( user == pre_jibri_user and domain == pre_jibri_domain ) then
local join = stanza:get_child("x", MUC_NS);
join:tag("password", { xmlns = MUC_NS }):text(room:get_password());
end;
end);
you can name it mod_jibri_bypass_pswd.lua
put it into prosody-plugins-custom directory and then
add this mod jibri_bypass_pswd to prosody/defaults/conf.d/jitsi-meet.cfg.lua
under main module_enabled and Component "{{ .Env.XMPP_INTERNAL_MUC_DOMAIN }}" "muc".
snippet how I added
modules_enabled = {
"bosh";
"pubsub";
"ping";
"speakerstats";
"conference_duration";
{{ if and $ENABLE_LOBBY (not $ENABLE_GUEST_DOMAIN) }}
"muc_lobby_rooms";
{{ end }}
{{ if .Env.XMPP_MODULES }}
"{{ join "\";\n\"" (splitList "," .Env.XMPP_MODULES) }}";
{{ end }}
{{ if and $ENABLE_AUTH (eq $AUTH_TYPE "ldap") }}
"auth_cyrus";
{{end}}
{{ if .Env.ENABLE_RECORDING }}
"jibri_bypass_pswd";
{{ end }}
}
Component "{{ .Env.XMPP_INTERNAL_MUC_DOMAIN }}" "muc"
storage = "memory"
modules_enabled = {
"ping";
{{ if .Env.XMPP_INTERNAL_MUC_MODULES }}
"{{ join "\";\n\"" (splitList "," .Env.XMPP_INTERNAL_MUC_MODULES) }}";
{{ end }}
{{ if .Env.ENABLE_RECORDING }}
"jibri_bypass_pswd";
{{ end }}
}
muc_room_locking = false
muc_room_default_public_jids = true
NOTE: Add ENABLE_RECORDING=1 under prosody service env

Related

Not able to take the screenshot in aws device farm for android appication automation testing

Can you please help me to resolve this screenshot issue. I have written the method which I am calling on every screen but I am getting an error while the test is running. I have tried on this question also but I could not find the answers. Here is my code for screenshot
public static boolean takeScreenshotAtEndOfTest(AndroidDriver<MobileElement> driver) {
Timestamp timestamp = new Timestamp(System.currentTimeMillis());
String screenshotDirectory = System.getenv("DEVICEFARM_LOG_DIR");
File screenshot = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE);
return screenshot.renameTo(new File(screenshotDirectory, String.format("%s.png", timestamp)));
}
Here is the error which I am getting :
startApplication org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to remote server. Original error: The request to /screenshot has failed Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03' System info: host: 'ip-172-31-13-65', ip: '172.31.13.65', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-139-generic', java.version: '1.8.0_151' Driver info: io.appium.java_client.android.AndroidDriver Capabilities {app: /tmp/scratchjCnSt_.scratch/..., appPackage: com.company, autoGrantPermissions: true, databaseEnabled: false, desired: {app: /tmp/scratchjCnSt_.scratch/..., autoGrantPermissions: true, deviceName: Android, platformName: android, udid: HT85G1A03343}, deviceApiLevel: 28, deviceManufacturer: Google, deviceModel: Pixel 2, deviceName: HT85G1A03343, deviceScreenDensity: 420, deviceScreenSize: 1080x1920, deviceUDID: HT85G1A03343, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: true, pixelRatio: 2.625, platform: LINUX, platformName: Android, platformVersion: 9, statBarHeight: 63, takesScreenshot: true, udid: HT85G1A03343, viewportRect: {height: 1731, left: 0, top: 63, width: 1080}, warnings: {}, webStorageEnabled: false} Session ID: 61633183-071b-4c90-9173-addf700d60b7 at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122) at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158) at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:239) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552) at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:45) at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1) at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1) at org.openqa.selenium.remote.RemoteWebDriver.getScreenshotAs(RemoteWebDriver.java:295) at com.name.impl.CommonImpl.takeScreenshotAtEndOfTest(CommonImpl.java:207)

Selenium tests are failing due to org.openqa.selenium.NoSuchSessionException: invalid session id on two different machine

org.openqa.selenium.NoSuchSessionException: invalid session id
Build info: version: '3.9.1', revision: '63f7b50', time: '2018-02-07T22:25:02.294Z'
System info: host: 'chaos', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.10.0-957.21.3.el7.x86_64', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 83.0.4103.106, chrome: {chromedriverVersion: 83.0.4103.39 (ccbf011cb2d2b..., userDataDir: /tmp/.com.google.Chrome.XiR2sj}, goog:chromeOptions: {debuggerAddress: localhost:37450}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: LINUX, platformName: LINUX, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:virtualAuthenticators: true}
Session ID: cf2b9146e49c20dccbba70b575b2a393
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:160)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:325)
at com.tomtom.workflow.iris.uitest.pages.LoginService.logout(LoginService.java:66)
This problem is coming while loggingin and logged out into the application.
I have verified the chrome version/browser compatibility as well.
Some tome tests are running well and some time multiple tests ae getting failed due to this reason.
Options I have tried:
checked Chrome driver compatibility:
browserVersion: 83.0.4103.106,chromedriverVersion: 83.0.4103.39
I have also checked the test;there is no use of driver.quit() and
driver.close()
Selenium server version is "3.141.59".
JDK version is "1.8".
Problem is coming in executing the below code:
public void logout(String url) throws URISyntaxException {
// when user is logged out
URIBuilder uri = new URIBuilder(url);
uri.setPath("uiris/logout");
**$.driver().get().get(uri.toString());** //this line is causing the
issue.
$("*[id='login.signIn']").waitUntil(5000).isPresent();
LOG.info("log out is done successfully.");
}
I am not able to understand what is the issue.
The issue is not reproduced, if the tests are run on the local machine. But
when tests are running on two different Jenkins created machines in
parallel, then multiple tests are getting failed due to this problem only on
one machine.
Iam not able to identitify,if theerei somethng wrong with the machne on which tests are running or there is some issue withn the chrome driver.
Anybody can help me with this?
The issue is that both machines are using the same chrome session

Not able to do Sendkeys() in Username box. It shows Elementnotinteractable Exception using Selenium Webdriver

In Registration Form, Trying to enter text in username text box using sendkeys(). But it throws ElementNotInteractable Exception. Then i used implicit wait and webdriverwait to find that element , it also throwed be Timeout Exception. Kindly suggest a solutions for this, as i am not able to proceed for here. Used selenium Webdriver with java.
here is the site used
Attached the DOM tree image
Code Below:
#Test
public void regform() {
System.setProperty("webdriver.chrome.driver", "./drivers/chromedriver.exe");
RemoteWebDriver d = new ChromeDriver();
d.manage().window().maximize();
d.get("http://way2automation.com/way2auto_jquery/index.php");
d.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
WebDriverWait wait = new WebDriverWait(d, 20);
WebElement usrname = d.findElementByXPath("//input[#name='username']");
wait.until(ExpectedConditions.visibilityOf(usrname));
usrname.sendKeys("User1");
d.close();
}
Console Log:
FAILED: regform
org.openqa.selenium.TimeoutException: Expected condition failed: waiting for visibility of [[ChromeDriver: chrome on WINDOWS (12e645803db8e870be7722d06896cc88)] -> xpath: //input[#name='username']] (tried for 20 second(s) with 500 milliseconds interval)
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'DESKTOP-O0V8JPK', ip: '192.168.1.12', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_171'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 81.0.4044.138, chrome: {chromedriverVersion: 80.0.3987.106 (f68069574609..., userDataDir: C:\Users\Shamili\AppData\Lo...}, goog:chromeOptions: {debuggerAddress: localhost:61086}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify}
Session ID: 12e645803db8e870be7722d06896cc88
at org.openqa.selenium.support.ui.WebDriverWait.timeoutException(WebDriverWait.java:95)
at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:272)
at basicautomationconcepts.RegistrationForm.regform(RegistrationForm.java:24)
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 org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:133)
at org.testng.internal.TestInvoker.invokeMethod(TestInvoker.java:584)
at org.testng.internal.TestInvoker.invokeTestMethod(TestInvoker.java:172)
at org.testng.internal.MethodRunner.runInSequence(MethodRunner.java:46)
at org.testng.internal.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:804)
at org.testng.internal.TestInvoker.invokeTestMethods(TestInvoker.java:145)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:128)
at java.util.ArrayList.forEach(ArrayList.java:1257)
at org.testng.TestRunner.privateRun(TestRunner.java:770)
at org.testng.TestRunner.run(TestRunner.java:591)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:402)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:396)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:355)
at org.testng.SuiteRunner.run(SuiteRunner.java:304)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:96)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1180)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1102)
at org.testng.TestNG.runSuites(TestNG.java:1032)
at org.testng.TestNG.run(TestNG.java:1000)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:115)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
The page you try to automate contains two similar forms, hence there are two elements within the DOM that match your XPath. The first one is not displayed and thus not interactable. That is why you got ElementNotInteractableException, and that is why you get TimeoutException trying to wait until it became visible.
Changing your xpath to "(//input[#name='username'])[2]" should solve the problem.
You can also try with the below xpath. It worked for me.
"//*[#id=\"load_form\"]/fieldset[6]/input"

"cannot focus element" exception while trying to upload an attachment using selenium

While trying to upload an attachment, trying to send the keys instead of opening the OS based file explorer window as sending the path to the file would be easy.
Tried with different element identifiers, still not able to send the keys. mentioned the element HTML below.
Attached the image of element.
Tried Below Xpath,
//*[#id='fileListVideo']//*[starts-with(#class,'qq-upload-button')]
Error Log:
org.openqa.selenium.WebDriverException: unknown error: cannot focus element
(Session info: chrome=66.0.3359.181)
(Driver info: chromedriver=2.39.562713 (dd642283e958a93ebf6891600db055f1f1b4f3b2),platform=Mac OS X 10.13.4 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T14:04:26.12Z'
System info: host: 'nagarjunaMBP.local', ip: 'fe80:0:0:0:c2e:b816:67ae:922b%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.4', java.version: '1.8.0_60'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities {acceptInsecureCerts: false, acceptSslCerts: false, applicationCacheEnabled: false, browserConnectionEnabled: false, browserName: chrome, chrome: {chromedriverVersion: 2.39.562713 (dd642283e958a9..., userDataDir: /var/folders/g4/dylg4g7s7wb...}, cssSelectorsEnabled: true, databaseEnabled: false, handlesAlerts: true, hasTouchScreen: false, javascriptEnabled: true, locationContextEnabled: true, mobileEmulationEnabled: false, nativeEvents: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: MAC, platformName: MAC, rotatable: false, setWindowRect: true, takesHeapSnapshot: true, takesScreenshot: true, unexpectedAlertBehaviour: , unhandledPromptBehavior: , version: 66.0.3359.181, webStorageEnabled: true}
Session ID: 38b991ebd4acf37fd0aefaef902853f9
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)
at org.openqa.selenium.remote.http.JsonHttpResponseCodec.reconstructValue(JsonHttpResponseCodec.java:40)
at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:80)
at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:44)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:276)
at org.openqa.selenium.remote.RemoteWebElement.sendKeys(RemoteWebElement.java:100)
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:497)
at org.openqa.selenium.support.pagefactory.internal.LocatingElementHandler.invoke(LocatingElementHandler.java:51)
at com.sun.proxy.$Proxy17.sendKeys(Unknown Source)
at actions.PublishBroadcast.MediaLibAction.uploadVideos(MediaLibAction.java:76)
at stepDefinitions.Publish.SDMediaLibrary.Upload_an_Image(SDMediaLibrary.java:43)
at ✽.When Upload an Image(features/publish/mediaLibrary/MediaLibrary.feature:10)
If you are trying to upload a file, and the page uses the standard upload mechanisms provided by HTML, you can do this directly with Selenium itself. The standard HTML mechanism is with an <input type=‘file’> element. Once you’ve found that file upload element on the page, you can use element.sendKeys(“full/path/and/file/name/here”);
where element would be :
WebElement element = driver.findElement(By.cssSelector(input[type='file']));
I was trying with the path to div which will not accept the values. So changes the path to input value //*[#id='fileList']//*[#type='file'] or //*[#id='fileList']//input[#type='file'] this worked.
Thanks to #Andersson

Invalid Xpath expression

My Html is like:
<pre>
<ul class="dropdown-menu dropdown-triangle-bottom-right">
<li class="post-save-publish">
Publish Now
</li>
<li class="post-save-draft active">
Save Draft
</li>
<li class="divider delete"/>
<li class="delete">
Delete Post
</li>
</ul>
</pre>
Code for handling Publish Now button:
WebElement t=driver.findElement(By.xpath("//*[#href='#' AND text()='Publish Now']"))
I am getting error :
1494681211957 geckodriver INFO Listening on 127.0.0.1:44241
1494681212176 mozprofile::profile INFO Using profile path /var/folders/dg/glyvppvs1dn31sqrrgt7yhjc0000gn/T/rust_mozprofile.4mJ76F47MPkl
1494681212177 geckodriver::marionette INFO Starting browser /Applications/Firefox.app/Contents/MacOS/firefox-bin with args []
1494681212181 geckodriver::marionette INFO Connecting to Marionette on localhost:60723
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
1494681212732 Marionette INFO Listening on port 60723
May 13, 2017 6:43:34 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
JavaScript warning: http://localhost:2368/ghost/vendor.js?v=115d872ce7, line 2753: mutating the [[Prototype]] of an object will cause your code to run very slowly; instead create the object with the correct initial [[Prototype]] value using Object.create
Exception in thread "main" org.openqa.selenium.InvalidSelectorException: Given xpath expression "//*[#href='#' AND text()='Publish Now']" is invalid
For documentation on this error, please visit: http://seleniumhq.org/exceptions/invalid_selector_exception.html
Build info: version: '3.3.1', revision: '5234b32', time: '2017-03-10 09:04:52 -0800'
System info: host: 'Javeds-MacBook-Pro.local', ip: 'fd50:1d9:9d9b:eb00:6d64:a5da:2f9c:7790', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.4', java.version: '1.8.0_112'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities [{rotatable=false, raisesAccessibilityExceptions=false, appBuildId=20160623154057, version=47.0.1, platform=MAC, proxy={}, command_id=1, specificationLevel=0, acceptSslCerts=false, browserVersion=47.0.1, platformVersion=16.5.0, XULappId={ec8030f7-c20a-464f-9b0e-13a3a9e97384}, browserName=Firefox, takesScreenshot=true, takesElementScreenshot=true, platformName=Darwin, device=desktop}]
Session ID: 440c0fbb-62f8-ec43-9965-b3a154425a21
*** Element info: {Using=xpath, value=//*[#href='#' AND text()='Publish Now']}
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:133)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:99)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:43)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:163)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:604)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:371)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByXPath(RemoteWebDriver.java:476)
at org.openqa.selenium.By$ByXPath.findElement(By.java:361)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:363)
at TestingBlogWebsite.AdminWebsite.main(AdminWebsite.java:313)
You get error because you should use XPath operators in lower case as
"//*[#href='#' and text()='Publish Now']"
Try
//*[#href='#' and .='Publish Now']
or
//*[#href='#' and contains(text(), 'Publish Now')]