Appium not clicking on button and Test is passed - selenium
I am new in appium. So, i did complete setup and my application launch successfully. But after launching app, No click action is performed on element.
Code--->
package functionlity;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import io.appium.java_client.AppiumDriver;
import io.appium.java_client.android.AndroidDriver;
public class Login {
WebDriver driver;
#BeforeClass(alwaysRun = true)
public void Loadsetup() {
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.BROWSER_NAME, "");
capabilities.setCapability("deviceName", "dcd9e0817d63");
capabilities.setCapability("VERSION", "6.0");
capabilities.setCapability("platformName", "Android");
capabilities.setCapability("appPackage", "com.engagebeyond.load");
capabilities.setCapability("appActivity", "com.engagebeyond.load.Splesh");
try {
driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities);
} catch (MalformedURLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
}
#Test(priority=1)
public void Logincase_01() throws InterruptedException{
Thread.sleep(5000);
WebElement w=driver.findElement(By.id("com.engagebeyond.load:id/c1"));
System.out.println(w);
w.click();
}
}
Appium Log--->
> Launching Appium server with command: C:\Program Files (x86)\Appium\node.exe lib\server\main.js --address 127.0.0.1 --port 4723 --app D:\Appiumnewproject\Load-com.engagebeyond.load-33-v3.3.apk --no-reset --platform-name Android --platform-version 23 --automation-name Appium --log-no-color
> info: Welcome to Appium v1.4.16 (REV ae6877eff263066b26328d457bd285c0cc62430d)
> info: Appium REST http interface listener started on 127.0.0.1:4723
> info: [debug] Non-default server args: {"app":"D:\\Appiumnewproject\\Load-com.engagebeyond.load-33-v3.3.apk","address":"127.0.0.1","noReset":true,"logNoColors":true,"platformName":"Android","platformVersion":"23","automationName":"Appium"}
> info: Console LogLevel: debug
> info: --> POST /wd/hub/session {"desiredCapabilities":{"platformName":"Android","VERSION":"6.0","deviceName":"dcd9e0817d63","appActivity":"com.engagebeyond.load.Splesh","browserName":"","appPackage":"com.engagebeyond.load"}}
> info: Client User-Agent string: Apache-HttpClient/4.5.1 (Java/1.7.0_79)
> info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : VERSION
> info: [debug] Using local app from command line: D:\Appiumnewproject\Load-com.engagebeyond.load-33-v3.3.apk
> info: [debug] Creating new appium session 2980c636-5d38-4e5c-8c75-0717d1da26b9
> info: Starting android appium
> info: [debug] Getting Java version
> info: Java version is: 1.6.0_16
> info: [debug] Checking whether adb is present
> info: [debug] Using adb from D:\android-sdk-windows\platform-tools\adb.exe
> info: [debug] Using fast reset? false
> info: [debug] Preparing device for session
> info: [debug] Checking whether app is actually present
> info: Retrieving device
> info: [debug] Trying to find a connected android device
> info: [debug] Getting connected devices...
> info: [debug] executing cmd: D:\android-sdk-windows\platform-tools\adb.exe devices
> info: [debug] 1 device(s) connected
> info: Found device dcd9e0817d63
> info: [debug] Setting device id to dcd9e0817d63
> info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
> info: [debug] executing cmd: D:\android-sdk-windows\platform-tools\adb.exe -s dcd9e0817d63 wait-for-device
> info: [debug] executing cmd: D:\android-sdk-windows\platform-tools\adb.exe -s dcd9e0817d63 shell "echo 'ready'"
> info: [debug] Starting logcat capture
> info: [debug] Getting device API level
> info: [debug] executing cmd: D:\android-sdk-windows\platform-tools\adb.exe -s dcd9e0817d63 shell "getprop ro.build.version.sdk"
> info: [debug] Device is at API Level 23
> info: Device API level is: 23
> info: [debug] Extracting strings for language: default
> info: [debug] executing cmd: D:\android-sdk-windows\platform-tools\adb.exe -s dcd9e0817d63 shell "getprop persist.sys.language"
> info: [debug] Current device persist.sys.language:
> info: [debug] java -jar "C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\jars\appium_apk_tools_1.6.jar" "stringsFromApk" "D:\Appiumnewproject\Load-com.engagebeyond.load-33-v3.3.apk" "c:\Temp\com.engagebeyond.load"
> info: [debug] No strings.xml for language '', getting default strings.xml
> info: [debug] java -jar "C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\jars\appium_apk_tools_1.6.jar" "stringsFromApk" "D:\Appiumnewproject\Load-com.engagebeyond.load-33-v3.3.apk" "c:\Temp\com.engagebeyond.load"
> warn: Error getting strings.xml from apk
> info: [debug] Exception in thread "main" brut.androlib.AndrolibException: Could not decode arsc file
> at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:54)
> at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:540)
> at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:76)
> at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:68)
> at io.appium.apktools.StringsXML.run(StringsXML.java:84)
> at io.appium.apktools.Main.main(Main.java:31)
> Caused by: java.io.IOException: Expected: 0x001c0001, got: 0x00000000
> at brut.util.ExtDataInput.skipCheckInt(ExtDataInput.java:48)
> at brut.androlib.res.decoder.StringBlock.read(StringBlock.java:43)
> at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:100)
> at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:81)
> at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:49)
> ... 5 more
>
> warn: Could not get strings, continuing anyway
> info: [debug] executing cmd: D:\android-sdk-windows\platform-tools\adb.exe -s dcd9e0817d63 shell "echo '{}' > /data/local/tmp/strings.json"
> info: [debug] Checking whether aapt is present
> info: [debug] Using aapt from D:\android-sdk-windows\build-tools\26.0.0-preview\aapt.exe
> info: [debug] Retrieving process from manifest.
> info: [debug] executing cmd: D:\android-sdk-windows\build-tools\26.0.0-preview\aapt.exe dump xmltree D:\Appiumnewproject\Load-com.engagebeyond.load-33-v3.3.apk AndroidManifest.xml
> info: [debug] Set app process to: com.engagebeyond.load
> info: [debug] Not uninstalling app since server not started with --full-reset
> info: [debug] Checking app cert for D:\Appiumnewproject\Load-com.engagebeyond.load-33-v3.3.apk.
> info: [debug] executing cmd: java -jar "C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\jars\verify.jar" D:\Appiumnewproject\Load-com.engagebeyond.load-33-v3.3.apk
> info: [debug] App already signed.
> info: [debug] Zip-aligning D:\Appiumnewproject\Load-com.engagebeyond.load-33-v3.3.apk
> info: [debug] Checking whether zipalign is present
> info: [debug] Using zipalign from D:\android-sdk-windows\build-tools\26.0.0-preview\zipalign.exe
> info: [debug] Zip-aligning apk.
> info: [debug] executing cmd: D:\android-sdk-windows\build-tools\26.0.0-preview\zipalign.exe -f 4 D:\Appiumnewproject\Load-com.engagebeyond.load-33-v3.3.apk c:\Temp\117320-672-a5var0\appium.tmp
> info: [debug] MD5 for app is 1ef6766ab258f337503deaecd232d00c
> info: [debug] executing cmd: D:\android-sdk-windows\platform-tools\adb.exe -s dcd9e0817d63 shell "ls /data/local/tmp/1ef6766ab258f337503deaecd232d00c.apk"
> info: [debug] Getting install status for com.engagebeyond.load
> info: [debug] Getting device API level
> info: [debug] executing cmd: D:\android-sdk-windows\platform-tools\adb.exe -s dcd9e0817d63 shell "getprop ro.build.version.sdk"
> info: [debug] Device is at API Level 23
> info: [debug] executing cmd: D:\android-sdk-windows\platform-tools\adb.exe -s dcd9e0817d63 shell "pm list packages -3 com.engagebeyond.load"
> info: [debug] App is installed
> info: [debug] Forwarding system:4724 to device:4724
> info: [debug] executing cmd: D:\android-sdk-windows\platform-tools\adb.exe -s dcd9e0817d63 forward tcp:4724 tcp:4724
> info: [debug] Pushing appium bootstrap to device...
> info: [debug] executing cmd: D:\android-sdk-windows\platform-tools\adb.exe -s dcd9e0817d63 push "C:\\Program Files (x86)\\Appium\\node_modules\\appium\\build\\android_bootstrap\\AppiumBootstrap.jar" /data/local/tmp/
> info: [debug] Pushing settings apk to device...
> info: [debug] executing cmd: D:\android-sdk-windows\platform-tools\adb.exe -s dcd9e0817d63 install "C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk"
> info: [debug] Pushing unlock helper app to device...
> info: [debug] executing cmd: D:\android-sdk-windows\platform-tools\adb.exe -s dcd9e0817d63 install "C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk"
> info: Starting App
> info: [debug] Attempting to kill all 'uiautomator' processes
> info: [debug] Getting all processes with 'uiautomator'
> info: [debug] executing cmd: D:\android-sdk-windows\platform-tools\adb.exe -s dcd9e0817d63 shell "ps 'uiautomator'"
> info: [debug] No matching processes found
> info: [debug] Running bootstrap
> info: [debug] spawning: D:\android-sdk-windows\platform-tools\adb.exe -s dcd9e0817d63 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e pkg com.engagebeyond.load -e disableAndroidWatchers false
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
> info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1
> info: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724
> info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready
> info: [debug] [BOOTSTRAP] [debug] Loading json...
> info: [debug] [BOOTSTRAP] [debug] json loading complete.
> info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
> info: [debug] Waking up device if it's not alive
> info: [debug] Pushing command to appium work queue: ["wake",{}]
> info: [debug] [BOOTSTRAP] [debug] Client connected
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"wake","params":{}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: wake
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":true}
> info: [debug] executing cmd: D:\android-sdk-windows\platform-tools\adb.exe -s dcd9e0817d63 shell "dumpsys window"
> info: [debug] Screen already unlocked, continuing.
> info: [debug] Pushing command to appium work queue: ["getDataDir",{}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"getDataDir","params":{}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: getDataDir
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":"\/data\/local\/tmp"}
> info: [debug] dataDir set to: /data/local/tmp
> info: [debug] Pushing command to appium work queue: ["compressedLayoutHierarchy",{"compressLayout":false}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"compressedLayoutHierarchy","params":{"compressLayout":false}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: compressedLayoutHierarchy
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":false}
> info: [debug] Getting device API level
> info: [debug] executing cmd: D:\android-sdk-windows\platform-tools\adb.exe -s dcd9e0817d63 shell "getprop ro.build.version.sdk"
> info: [debug] Device is at API Level 23
> info: [debug] executing cmd: D:\android-sdk-windows\platform-tools\adb.exe -s dcd9e0817d63 shell "am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n com.engagebeyond.load/com.engagebeyond.load.Splesh"
> info: [debug] Waiting for pkg "com.engagebeyond.load" and activity "com.engagebeyond.load.Splesh" to be focused
> info: [debug] Getting focused package and activity
> info: [debug] executing cmd: D:\android-sdk-windows\platform-tools\adb.exe -s dcd9e0817d63 shell "dumpsys window windows"
> info: [debug] executing cmd: D:\android-sdk-windows\platform-tools\adb.exe -s dcd9e0817d63 shell "getprop ro.build.version.release"
> info: [debug] Device is at release version 6.0.1
> info: [debug] Device launched! Ready for commands
> info: [debug] Setting command timeout to the default of 60 secs
> info: [debug] Appium session started with sessionId 2980c636-5d38-4e5c-8c75-0717d1da26b9
> info: <-- POST /wd/hub/session 303 16397.110 ms - 74
> info: --> GET /wd/hub/session/2980c636-5d38-4e5c-8c75-0717d1da26b9 {}
> info: [debug] Responding to client with success: {"status":0,"value":{"platform":"LINUX","browserName":"","platformVersion":"6.0.1","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"Android","VERSION":"6.0","deviceName":"dcd9e0817d63","appActivity":"com.engagebeyond.load.Splesh","browserName":"","appPackage":"com.engagebeyond.load"},"platformName":"Android","VERSION":"6.0","deviceName":"dcd9e0817d63","appActivity":"com.engagebeyond.load.Splesh","appPackage":"com.engagebeyond.load"},"sessionId":"2980c636-5d38-4e5c-8c75-0717d1da26b9"}
> info: <-- GET /wd/hub/session/2980c636-5d38-4e5c-8c75-0717d1da26b9 200 7.609 ms - 641 {"status":0,"value":{"platform":"LINUX","browserName":"","platformVersion":"6.0.1","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"Android","VERSION":"6.0","deviceName":"dcd9e0817d63","appActivity":"com.engagebeyond.load.Splesh","browserName":"","appPackage":"com.engagebeyond.load"},"platformName":"Android","VERSION":"6.0","deviceName":"dcd9e0817d63","appActivity":"com.engagebeyond.load.Splesh","appPackage":"com.engagebeyond.load"},"sessionId":"2980c636-5d38-4e5c-8c75-0717d1da26b9"}
> info: --> POST /wd/hub/session/2980c636-5d38-4e5c-8c75-0717d1da26b9/timeouts {"type":"implicit","ms":15000}
> info: [debug] Set Android implicit wait to 15000ms
> info: [debug] Responding to client with success: {"status":0,"value":null,"sessionId":"2980c636-5d38-4e5c-8c75-0717d1da26b9"}
> info: <-- POST /wd/hub/session/2980c636-5d38-4e5c-8c75-0717d1da26b9/timeouts 200 6.394 ms - 76 {"status":0,"value":null,"sessionId":"2980c636-5d38-4e5c-8c75-0717d1da26b9"}
> info: --> POST /wd/hub/session/2980c636-5d38-4e5c-8c75-0717d1da26b9/element {"using":"id","value":"com.engagebeyond.load:id/c1"}
> info: [debug] Waiting up to 15000ms for condition
> info: [debug] Pushing command to appium work queue: ["find",{"strategy":"id","selector":"com.engagebeyond.load:id/c1","context":"","multiple":false}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.engagebeyond.load:id/c1","context":"","multiple":false}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: find
> info: [debug] [BOOTSTRAP] [debug] Finding com.engagebeyond.load:id/c1 using ID with the contextId: multiple: false
> info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.engagebeyond.load:id/c1]
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":{"ELEMENT":"1"}}
> info: [debug] Responding to client with success: {"status":0,"value":{"ELEMENT":"1"},"sessionId":"2980c636-5d38-4e5c-8c75-0717d1da26b9"}
> info: <-- POST /wd/hub/session/2980c636-5d38-4e5c-8c75-0717d1da26b9/element 200 32.339 ms - 87 {"status":0,"value":{"ELEMENT":"1"},"sessionId":"2980c636-5d38-4e5c-8c75-0717d1da26b9"}
> info: --> POST /wd/hub/session/2980c636-5d38-4e5c-8c75-0717d1da26b9/element/1/click {"id":"1"}
> info: [debug] Pushing command to appium work queue: ["element:click",{"elementId":"1"}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:click","params":{"elementId":"1"}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: click
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":true}
> info: [debug] Responding to client with success: {"status":0,"value":true,"sessionId":"2980c636-5d38-4e5c-8c75-0717d1da26b9"}
> info: <-- POST /wd/hub/session/2980c636-5d38-4e5c-8c75-0717d1da26b9/element/1/click 200 64.664 ms - 76 {"status":0,"value":true,"sessionId":"2980c636-5d38-4e5c-8c75-0717d1da26b9"}
> info: [debug] Didn't get a new command in 60 secs, shutting down...
> info: Shutting down appium session
> info: [debug] Pressing the HOME button
> info: [debug] executing cmd: D:\android-sdk-windows\platform-tools\adb.exe -s dcd9e0817d63 shell "input keyevent 3"
> info: [debug] Stopping logcat capture
> info: [debug] Logcat terminated with code null, signal SIGTERM
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"shutdown"}
> info: [debug] [BOOTSTRAP] [debug] Got command of type SHUTDOWN
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":"OK, shutting down"}
> info: [debug] Sent shutdown command, waiting for UiAutomator to stop...
> info: [debug] [BOOTSTRAP] [debug] Closed client connection
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=.
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 0
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
> info: [debug] [UIAUTOMATOR STDOUT] Test results for WatcherResultPrinter=.
> info: [debug] [UIAUTOMATOR STDOUT] Time: 68.444
> info: [debug] [UIAUTOMATOR STDOUT] OK (1 test)
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1
> info: [debug] UiAutomator shut down normally
> info: [debug] Cleaning up android objects
> info: [debug] Cleaning up appium session
> info: [debug] We shut down because no new commands came in
please suggest me solution. here what is wrong with my code.I am new in appium. So, i did complete setup and my application launch successfully. But after launching app, No click action is performed on element
If you see your log file, it has this output -
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:click","params":{"elementId":"1"}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: click
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":true}
> info: [debug] Responding to client with success: {"status":0,"value":true,"sessionId":"2980c636-5d38-4e5c-8c75-0717d1da26b9"}
This means that Appium was able to successfully click on the element, based on the identifier you provided. Maybe there is an issue with the identifier you have used, and that's why appium is not clicking on the correct element.
Would it be possible for you to share the UIAutomatorViewer screenshot, so that we can have a look at the object properties?
Related
authenticate against sonatype ossindex with maven plugin
I am using the mvn org.sonatype.ossindex.maven:ossindex-maven-plugin from command line to check the dependencies of a maven project for CVEs. Locally, everything works fine, but in my build pipeline in Azure Devops, I get the following error: [DEBUG] Connecting to ossindex.sonatype.org/18.118.116.156:443 [DEBUG] Connecting socket to ossindex.sonatype.org/18.118.116.156:443 with timeout 0 [DEBUG] Enabled protocols: [TLSv1.3, TLSv1.2] [DEBUG] Enabled cipher suites:[TLS_AES_128_GCM_SHA256, TLS_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_DSS_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384, TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, TLS_DHE_DSS_WITH_AES_256_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_EMPTY_RENEGOTIATION_INFO_SCSV] [DEBUG] Starting handshake [DEBUG] Secure session established [DEBUG] negotiated protocol: TLSv1.2 [DEBUG] negotiated cipher suite: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 [DEBUG] peer principal: CN=ossindex.sonatype.org [DEBUG] peer alternative names: [ossindex.sonatype.org] [DEBUG] issuer principal: CN=Amazon, OU=Server CA 1B, O=Amazon, C=US [DEBUG] Connection established 172.21.1.242:33030<->18.118.116.156:443 [DEBUG] Executing request POST /api/v3/component-report HTTP/1.1 [DEBUG] Proxy auth state: UNCHALLENGED [DEBUG] http-outgoing-2 >> POST /api/v3/component-report HTTP/1.1 [DEBUG] http-outgoing-2 >> User-Agent: ossindex-client/1.1.1 (Linux; 5.4.0-124-generic; amd64; 11.0.12) Maven/3.8.1 Maven-Plugin/3.1.0 [DEBUG] http-outgoing-2 >> Authorization: Basic {SOME_BASE_64_THAT_TRANSLATES_TO:AzureDevOps:ey...} [DEBUG] http-outgoing-2 >> Accept: application/vnd.ossindex.component-report.v1+json [DEBUG] http-outgoing-2 >> Content-Length: 6737 [DEBUG] http-outgoing-2 >> Content-Type: application/vnd.ossindex.component-report-request.v1+json; charset=UTF-8 [DEBUG] http-outgoing-2 >> Host: ossindex.sonatype.org [DEBUG] http-outgoing-2 >> Connection: Keep-Alive [DEBUG] http-outgoing-2 >> Accept-Encoding: gzip,deflate [DEBUG] http-outgoing-2 >> "POST /api/v3/component-report HTTP/1.1[\r][\n]" [DEBUG] http-outgoing-2 >> "User-Agent: ossindex-client/1.1.1 (Linux; 5.4.0-124-generic; amd64; 11.0.12) Maven/3.8.1 Maven-Plugin/3.1.0[\r][\n]" [DEBUG] http-outgoing-2 >> "Authorization: Basic {SOME_OTHER_BASE64_NO_IDEA_WHERE_IT_COMES_FROM=[\r][\n]" [DEBUG] http-outgoing-2 >> "Accept: application/vnd.ossindex.component-report.v1+json[\r][\n]" [DEBUG] http-outgoing-2 >> "Content-Length: 6737[\r][\n]" [DEBUG] http-outgoing-2 >> "Content-Type: application/vnd.ossindex.component-report-request.v1+json; charset=UTF-8[\r][\n]" [DEBUG] http-outgoing-2 >> "Host: ossindex.sonatype.org[\r][\n]" [DEBUG] http-outgoing-2 >> "Connection: Keep-Alive[\r][\n]" [DEBUG] http-outgoing-2 >> "Accept-Encoding: gzip,deflate[\r][\n]" [DEBUG] http-outgoing-2 >> "[\r][\n]" [DEBUG] http-outgoing-2 >> "{"coordinates":[ A_LIST_OF_128_COORDINATES] [DEBUG] http-outgoing-2 << "HTTP/1.1 401 Unauthorized[\r][\n]" [DEBUG] http-outgoing-2 << "Date: Wed, 07 Dec 2022 13:51:42 GMT[\r][\n]" [DEBUG] http-outgoing-2 << "Content-Length: 0[\r][\n]" [DEBUG] http-outgoing-2 << "Connection: keep-alive[\r][\n]" so I tried setting the clientConfiguration parameter described here. it has a dead link but I believe it references this class which has this class as a member. mvn org.sonatype.ossindex.maven:ossindex-maven-plugin:3.1.0:audit -f $(Build.SourcesDirectory)/pom.xml -"Dossindex.authId=MY_SERVER" -"Dossindex.clientConfiguration={\"auth\": {\"username\": \"myemail#myorg.com\", \"password\": \"$(OSS_INDEX_API_TOKEN)\"} }" but it didn't change anything. Is this how one passes this parameter? Why am I getting a 401 in my build pipeline but everything works locally? I tried reading the docs on what requests are allowed/authorized but found them rather lacking...
Ingress NGINX client closed connection while SSL handshaking
we have ingress-nginx running for a while and about 10% of requests ending up with some SSL handshake problem. Here is an example of a failing connection: 2019/02/14 10:15:35 [debug] 237#237: *4612 accept: **.**.**.**:40928 fd:53 2019/02/14 10:15:35 [debug] 237#237: *4612 event timer add: 53: 60000:5527050245 2019/02/14 10:15:35 [debug] 237#237: *4612 reusable connection: 1 2019/02/14 10:15:35 [debug] 237#237: *4612 epoll add event: fd:53 op:1 ev:80002001 2019/02/14 10:15:45 [debug] 237#237: *4612 http check ssl handshake 2019/02/14 10:15:45 [debug] 237#237: *4612 http recv(): 0 2019/02/14 10:15:45 [info] 237#237: *4612 client closed connection while SSL handshaking, client: **.**.**.**, server: 0.0.0.0:443 2019/02/14 10:15:45 [debug] 237#237: *4612 close http connection: 53 2019/02/14 10:15:45 [debug] 237#237: *4612 event timer del: 53: 5527050245 2019/02/14 10:15:45 [debug] 237#237: *4612 reusable connection: 0 2019/02/14 10:15:45 [debug] 237#237: *4612 free: 00007F4CC5858E00, unused: 232 10% of failures seems to be quite a lot to expect. I really would appreciate any help in this!
How to find nested element in Android Appium testing?
I am new to Appium. I searched the web and tried several ways, but nothing worked. Please find the code below: driver.findElementByXPath("//android.widget.FrameLayout[1]/android.widget.FrameLayout[1]/android.widget.LinearLayout[1]/android.widget.RelativeLayout[#resource-id=\"in.dmart:id/linear_guide_view_skip\"]/android.widget.android.widget.TextView").click(); And driver.findElementByXPath("//android.widget.LinearLayout[1]/android.widget.RelativeLayout[1]/android.widget.android.widget.TextView[1]").click(); And driver.findElementByAndroidUIAutomator("text(\"GOT IT\")").click(); And List<WebElement>textView=driver.findElements(By.className("android.widget.android.widget.TextView")); for(i=0;i<textView.size();i++){ if(textView.get(i).getText().equals("GOT IT")) textView.get(i).click() } Please find UIAutomator Viewer screenshot attached: Server logs : [debug] [W3C] Calling AppiumDriver.findElements() with args: ["class name","android.widget.android.widget.TextView","e75769f1-53cb-44f7-9094-988b73fbc7be"] [debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator [debug] [BaseDriver] Waiting up to 0 ms for condition [debug] [AndroidBootstrap] Sending command to android: {"cmd":"action","action":"find","params":{"strategy":"class name","selector":"android.widget.android.widget.TextView","context":"","multiple":true}} [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"class name","selector":"android.widget.android.widget.TextView","context":"","multiple":true}} [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding 'android.widget.android.widget.TextView' using 'CLASS_NAME' with the contextId: '' multiple: true [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.android.widget.TextView] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.widget.android.widget.TextView] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (0) [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[CLASS=android.widget.android.widget.TextView, INSTANCE=0] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Failed to locate element. Clearing Accessibility cache and retrying. [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding 'android.widget.android.widget.TextView' using 'CLASS_NAME' with the contextId: '' multiple: true [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.android.widget.TextView] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements selector:UiSelector[CLASS=android.widget.android.widget.TextView] [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Element[] is null: (0) [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] getElements tmp selector:UiSelector[CLASS=android.widget.android.widget.TextView, INSTANCE=0] [debug] [AndroidBootstrap] Received command result from bootstrap [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":0,"value":[]} [debug] [W3C] Responding to client with driver.findElements() result: [] [HTTP] <-- POST /wd/hub/session/e75769f1-53cb-44f7-9094-988b73fbc7be/elements 200 13691 ms - 12
You can try like this. Please edit className value if it is different as per your app. get all elements of class name Click where text is "GOT IT" List<WebElement>textView = driver.findElements(By.className("android.widget.TextView")); for(i=0;i<textView.size();i++){ if(textView.get(i).getText().equals("GOT IT")) textView.get(i).click() }
By looking at the view hierarchy, to locate the TextView you don't need to worry about nested views. You can try with UiSelector() from UIAutomator as an example below. Refer to UiSelector documentation here. driver.findElementByAndroidUIAutomator("new UiSelector().text(\""+GOT IT+"\")").click(); Update: Try casting driver with AndroidDriver. ((AndroidDriver<MobileElement>)driver).findElementByAndroidUIAutomator("new UiSelector().text(\"GOT IT\")");
geckodriver connection refused
I try to get my selenium tests running on a debian server, but I keep getting connection refused error from my geckodriver. On my local machine it works perfectly which is running Ubuntu. Does any of you have an idea what is wrong? I wasn't able to find anything helpful. OS: Debian Jessie Build Tool: Gradle Java-Version: 8 Setup Method public static void setUp() { //System.setProperty("webdriver.gecko.driver", "geckodriver.exe"); //For debugging in windows System.setProperty("webdriver.gecko.driver", "geckodriver"); //for execution on linux //Bypass System.err while loading Webdriver PrintStream err = System.err; System.setErr(new PrintStream(new NullOutputStream())); driver = new FirefoxDriver(); System.setErr(err); webDriverWait = new WebDriverWait(driver, 1000); } Error Message org.openqa.selenium.WebDriverException: connection refused 14:44:04.899 [DEBUG] [TestEventLogger] Build info: version: '3.4.0', revision: 'unknown', time: 'unknown' 14:44:04.899 [DEBUG] [TestEventLogger] System info: host: 'security', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '3.16.0-4-amd64', java.version: '1.8.0_131' 14:44:04.899 [DEBUG] [TestEventLogger] Driver info: driver.version: FirefoxDriver 14:44:04.899 [DEBUG] [TestEventLogger] remote stacktrace: stack backtrace: 14:44:04.899 [DEBUG] [TestEventLogger] 0: 0x4fa94d - backtrace::backtrace::trace::h45ace4059cd74233 14:44:04.899 [DEBUG] [TestEventLogger] 1: 0x4fae32 - backtrace::capture::Backtrace::new::hb5a725a088a2a2fc 14:44:04.900 [DEBUG] [TestEventLogger] 2: 0x4349d9 - webdriver::error::WebDriverError::new::h449345a591a119fd 14:44:04.900 [DEBUG] [TestEventLogger] 3: 0x43f6b0 - geckodriver::marionette::MarionetteHandler::create_connection::h53f581202e4008b4 14:44:04.900 [DEBUG] [TestEventLogger] 4: 0x442839 - >::handle_command::hd89c5efbeb4c7cd5 14:44:04.900 [DEBUG] [TestEventLogger] 5: 0x434e94 - webdriver::server::start::{{closure}}::h5e71183f67357de6 14:44:04.900 [DEBUG] [TestEventLogger] 6: 0x408627 - std::panicking::try::do_call::h8c30e6af4c7f85af 14:44:04.904 [DEBUG] [TestEventLogger] 7: 0x5b77fa - panic_unwind::__rust_maybe_catch_panic 14:44:04.904 [DEBUG] [TestEventLogger] at /buildslave/rust-buildbot/slave/stable-dist-rustc-musl-linux/build/src/libpanic_unwind/lib.rs:98 14:44:04.907 [DEBUG] [TestEventLogger] 8: 0x416e57 - >::call_box::h3f273b2445d78deb 14:44:04.907 [DEBUG] [TestEventLogger] 9: 0x5b0014 - alloc::boxed::{{impl}}::call_once<(),()> 14:44:04.907 [DEBUG] [TestEventLogger] at /buildslave/rust-buildbot/slave/stable-dist-rustc-musl-linux/build/src/liballoc/boxed.rs:624 14:44:04.907 [DEBUG] [TestEventLogger] - std::sys_common::thread::start_thread 14:44:04.907 [DEBUG] [TestEventLogger] at /buildslave/rust-buildbot/slave/stable-dist-rustc-musl-linux/build/src/libstd/sys_common/thread.rs:21 14:44:04.907 [DEBUG] [TestEventLogger] - std::sys::imp::thread::{{impl}}::new::thread_start 14:44:04.908 [DEBUG] [TestEventLogger] at /buildslave/rust-buildbot/slave/stable-dist-rustc-musl-linux/build/src/libstd/sys/unix/thread.rs:84 14:44:04.908 [DEBUG] [TestEventLogger] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 14:44:04.908 [DEBUG] [TestEventLogger] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) 14:44:04.908 [DEBUG] [TestEventLogger] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 14:44:04.908 [DEBUG] [TestEventLogger] at java.lang.reflect.Constructor.newInstance(Constructor.java:423) 14:44:04.908 [DEBUG] [TestEventLogger] at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$new$0(W3CHandshakeResponse.java:57) 14:44:04.908 [DEBUG] [TestEventLogger] at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$getResponseFunction$2(W3CHandshakeResponse.java:104) 14:44:04.908 [DEBUG] [TestEventLogger] at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$22(ProtocolHandshake.java:365) 14:44:04.908 [DEBUG] [TestEventLogger] at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) 14:44:04.908 [DEBUG] [TestEventLogger] at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958) 14:44:04.909 [DEBUG] [TestEventLogger] at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126) 14:44:04.909 [DEBUG] [TestEventLogger] at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498) 14:44:04.909 [DEBUG] [TestEventLogger] at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485) 14:44:04.909 [DEBUG] [TestEventLogger] at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) 14:44:04.910 [DEBUG] [TestEventLogger] at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152) 14:44:04.910 [DEBUG] [TestEventLogger] at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) 14:44:04.911 [DEBUG] [TestEventLogger] at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464) 14:44:04.911 [DEBUG] [TestEventLogger] at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:368) 14:44:04.911 [DEBUG] [TestEventLogger] at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:159) 14:44:04.911 [DEBUG] [TestEventLogger] at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142) 14:44:04.911 [DEBUG] [TestEventLogger] at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:82) 14:44:04.912 [DEBUG] [TestEventLogger] at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:637) 14:44:04.914 [DEBUG] [TestEventLogger] at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:250) 14:44:04.914 [DEBUG] [TestEventLogger] at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:236) 14:44:04.798 [DEBUG] [org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor] Executing test class ch.siroop.security.test.a2.Cookies_Session 14:44:04.922 [DEBUG] [TestEventLogger] at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:137) 14:44:04.922 [DEBUG] [TestEventLogger] at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:191) 14:44:04.922 [DEBUG] [TestEventLogger] at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:108) 14:44:04.923 [DEBUG] [TestEventLogger] at org.openqa.selenium.firefox.FirefoxDriver.(FirefoxDriver.java:104) 14:44:04.923 [DEBUG] [TestEventLogger] at ch.siroop.security.test.a2.Login.setUp(Login.java:40) 14:44:04.923 [DEBUG] [TestEventLogger] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 14:44:04.923 [DEBUG] [TestEventLogger] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 14:44:04.923 [DEBUG] [TestEventLogger] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 14:44:04.923 [DEBUG] [TestEventLogger] at java.lang.reflect.Method.invoke(Method.java:498) 14:44:04.923 [DEBUG] [TestEventLogger] at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) 14:44:04.924 [DEBUG] [TestEventLogger] at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) 14:44:04.924 [DEBUG] [TestEventLogger] at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) 14:44:04.926 [DEBUG] [TestEventLogger] at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) 14:44:04.926 [DEBUG] [TestEventLogger] at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27) 14:44:04.927 [DEBUG] [TestEventLogger] at org.junit.runners.ParentRunner.run(ParentRunner.java:363) 14:44:04.927 [DEBUG] [TestEventLogger] at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:114) 14:44:04.927 [DEBUG] [TestEventLogger] at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:57) 14:44:04.927 [DEBUG] [TestEventLogger] at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:66) 14:44:04.927 [DEBUG] [TestEventLogger] at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:51) 14:44:04.927 [DEBUG] [TestEventLogger] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 14:44:04.927 [DEBUG] [TestEventLogger] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 14:44:04.927 [DEBUG] [TestEventLogger] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 14:44:04.927 [DEBUG] [TestEventLogger] at java.lang.reflect.Method.invoke(Method.java:498) 14:44:04.927 [DEBUG] [TestEventLogger] at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35) 14:44:04.927 [DEBUG] [TestEventLogger] at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) 14:44:04.930 [DEBUG] [TestEventLogger] at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32) 14:44:04.930 [DEBUG] [TestEventLogger] at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93) 14:44:04.934 [DEBUG] [TestEventLogger] at com.sun.proxy.$Proxy3.processTestClass(Unknown Source) 14:44:04.934 [DEBUG] [TestEventLogger] at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:109) 14:44:04.936 [DEBUG] [TestEventLogger] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 14:44:04.937 [DEBUG] [TestEventLogger] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 14:44:04.937 [DEBUG] [TestEventLogger] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 14:44:04.937 [DEBUG] [TestEventLogger] at java.lang.reflect.Method.invoke(Method.java:498) 14:44:04.937 [DEBUG] [TestEventLogger] at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35) 14:44:04.937 [DEBUG] [TestEventLogger] at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) 14:44:04.937 [DEBUG] [TestEventLogger] at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:377) 14:44:04.937 [DEBUG] [TestEventLogger] at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:54) 14:44:04.937 [DEBUG] [TestEventLogger] at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:40) 14:44:04.937 [DEBUG] [TestEventLogger] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 14:44:04.937 [DEBUG] [TestEventLogger] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 14:44:04.937 [DEBUG] [TestEventLogger] at java.lang.Thread.run(Thread.java:748)
I could finally figure out what caused the issue, I started the tests through ssh therefore the geckodriver didn't work. You have to add export DISPLAY=:0 to make it work. This tells Firefox how to use the display server.
Make sure that your version of gecko driver and Firefox is same i.e. both should be either 32 bit or 64 bit.
deploying war using tomcat7.maven plugin in eclipse but always throwing 401 unauthorized error
Need your help with this issue. I'm trying to deploy war file at localhost:8080 through eclipse using tomcat7.maven plugin version 2.1 scripts but always getting 401 unauthorized error. My PC OS is windows 7 64 bit. Here is my POM: <plugin> <groupId>org.apache.tomcat.maven</groupId> <artifactId>tomcat7-maven-plugin</artifactId> <configuration> <url>http://localhost:8080/manager/text</url> <server>localhost</server> <username>tomcat</username> <password>tomcat</password> <path>/${project.build.finalName}</path> <warDirectory>${project.build.directory}/exploded/${project.build.finalName}.war</warDirectory> <update>true</update> </configuration> <version>2.1</version> </plugin> Here is my tomcat-users.xml : <tomcat-users> <user name="admin" password="admin" roles="admin-gui,manager-gui"/> <role rolename="manager-script"/> <role rolename="manager"/> <role rolename="tomcat"/> <user username="tomcat" password="tomcat" roles="manager-script"/> </tomcat-users> Here is my settings.xml in /.M2 directory. <settings> <servers> <server> <id>localhost</id> <username>tomcat</username> <password>tomcat</password> </server> </servers> </settings> Here is my log file output: [DEBUG] Configuring mojo org.apache.tomcat.maven:tomcat7-maven-plugin:2.1:deploy from plugin realm ClassRealm[plugin>org.apache.tomcat.maven:tomcat7-maven-plugin:2.1, parent: sun.misc.Launcher$AppClassLoader#5d4177f3] [DEBUG] Configuring mojo 'org.apache.tomcat.maven:tomcat7-maven-plugin:2.1:deploy' with basic configurator --> [DEBUG] (f) charset = ISO-8859-1 [DEBUG] (f) contextFile = C:\java\Spring3HibernateMaven\target\Spring3HibernateMaven-0.0.1-SNAPSHOT\META-INF\context.xml [DEBUG] (f) ignorePackaging = false [DEBUG] (f) mode = war [DEBUG] (f) packaging = war [DEBUG] (f) password = tomcat [DEBUG] (f) path = /Spring3HibernateMaven-0.0.1-SNAPSHOT [DEBUG] (f) server = localhost [DEBUG] (f) update = true [DEBUG] (f) url = http://localhost:8080/manager/text [DEBUG] (f) username = tomcat [DEBUG] (f) version = 2.1 [DEBUG] (f) warFile = C:\java\Spring3HibernateMaven\target\Spring3HibernateMaven-0.0.1-SNAPSHOT.war [DEBUG] -- end configuration -- [INFO] Deploying war to http://localhost:8080/Spring3HibernateMaven-0.0.1-SNAPSHOT [DEBUG] Connection request: [route: {}->http://localhost:8080][total kept alive: 0; route allocated: 0 of 2; total allocated: 0 of 5] [DEBUG] Connection leased: [id: 0][route: {}->http://localhost:8080][total kept alive: 0; route allocated: 1 of 2; total allocated: 1 of 5] [DEBUG] Connecting to localhost:8080 [DEBUG] CookieSpec selected: best-match [DEBUG] Re-using cached 'basic' auth scheme for http://localhost:8080 [DEBUG] Target auth state: SUCCESS [DEBUG] Proxy auth state: UNCHALLENGED [DEBUG] Attempt 1 to execute request [DEBUG] Sending request: PUT /manager/text/deploy?path=%2FSpring3HibernateMaven-0.0.1-SNAPSHOT&update=true HTTP/1.1 [DEBUG] >> "PUT /manager/text/deploy?path=%2FSpring3HibernateMaven-0.0.1-SNAPSHOT&update=true HTTP/1.1[\r][\n]" [DEBUG] >> "User-Agent: Apache Tomcat Maven Plugin/2.1[\r][\n]" [DEBUG] >> "Content-Length: 11860176[\r][\n]" [DEBUG] >> "Host: localhost:8080[\r][\n]" [DEBUG] >> "Connection: Keep-Alive[\r][\n]" [DEBUG] >> "Authorization: Basic dG9tY2F0OnRvbWNhdA==[\r][\n]" [DEBUG] >> "[\r][\n]" [DEBUG] >> PUT /manager/text/deploy?path=%2FSpring3HibernateMaven-0.0.1-SNAPSHOT&update=true HTTP/1.1 [DEBUG] >> User-Agent: Apache Tomcat Maven Plugin/2.1 [DEBUG] >> Content-Length: 11860176 [DEBUG] >> Host: localhost:8080 [DEBUG] >> Connection: Keep-Alive [DEBUG] >> Authorization: Basic dG9tY2F0OnRvbWNhdA== Uploading: http://localhost:8080/manager/text/deploy?path=%2FSpring3HibernateMaven-0.0.1-SNAPSHOT&update=true Uploaded: http://localhost:8080/manager/text/deploy?path=%2FSpring3HibernateMaven-0.0.1-SNAPSHOT&update=true (11583 KB at 1833.5 KB/sec) [DEBUG] << "HTTP/1.1 401 Unauthorized[\r][\n]" [DEBUG] << "Server: Apache-Coyote/1.1[\r][\n]" [DEBUG] << "Cache-Control: private[\r][\n]" [DEBUG] << "Expires: Wed, 31 Dec 1969 18:00:00 CST[\r][\n]" [DEBUG] << "WWW-Authenticate: Basic realm="Tomcat Manager Application"[\r][\n]" [DEBUG] << "Content-Type: text/html;charset=ISO-8859-1[\r][\n]" [DEBUG] << "Transfer-Encoding: chunked[\r][\n]" [DEBUG] << "Date: Fri, 20 Sep 2013 05:24:35 GMT[\r][\n]" [DEBUG] << "[\r][\n]" [DEBUG] Receiving response: HTTP/1.1 401 Unauthorized [DEBUG] << HTTP/1.1 401 Unauthorized [DEBUG] << Server: Apache-Coyote/1.1 [DEBUG] << Cache-Control: private [DEBUG] << Expires: Wed, 31 Dec 1969 18:00:00 CST [DEBUG] << WWW-Authenticate: Basic realm="Tomcat Manager Application" [DEBUG] << Content-Type: text/html;charset=ISO-8859-1 [DEBUG] << Transfer-Encoding: chunked [DEBUG] << Date: Fri, 20 Sep 2013 05:24:35 GMT [DEBUG] Connection can be kept alive indefinitely [DEBUG] localhost:8080 requested authentication [DEBUG] Authorization challenge processed [DEBUG] Authentication failed [DEBUG] Removing from cache 'basic' auth scheme for http://localhost:8080 [DEBUG] << "9ea[\r][\n]" [DEBUG] << "[\r][\n]" [DEBUG] << "<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">[\r][\n]" [DEBUG] << "<html>[\r][\n]" [DEBUG] << " <head>[\r][\n]" [DEBUG] << " <title>401 Unauthorized</title>[\r][\n]" [DEBUG] << " <style type="text/css">[\r][\n]" [DEBUG] << " <!--[\r][\n]" [DEBUG] << " BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;font-size:12px;}[\r][\n]" [DEBUG] << " H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}[\r][\n]" [DEBUG] << " PRE, TT {border: 1px dotted #525D76}[\r][\n]" [DEBUG] << " A {color : black;}A.name {color : black;}[\r][\n]" [DEBUG] << " -->[\r][\n]" [DEBUG] << " </style>[\r][\n]" [DEBUG] << " </head>[\r][\n]" [DEBUG] << " <body>[\r][\n]" [DEBUG] << " <h1>401 Unauthorized</h1>[\r][\n]" [DEBUG] << " <p>[\r][\n]" [DEBUG] << " You are not authorized to view this page. If you have not changed[\r][\n]" [DEBUG] << " any configuration files, please examine the file[\r][\n]" [DEBUG] << " <tt>conf/tomcat-users.xml</tt> in your installation. That[\r][\n]" [DEBUG] << " file must contain the credentials to let you use this webapp.[\r][\n]" My Run Configuration in Eclipse: Maven Runtime: 3.1.0 ( External ) Goal: -X -e tomcat7:deploy