Software Engineering

For single web element in that row i got index..for multiple column in a single row how to get the index:

IWebElement colelement = driver.FindElement(By.XPath(“//div[@id=’grdBooking’]//table//tr/
th[contains(text(),’Case#’)]”));
String colidx = colelement.GetAttribute(“idx”);
Console.WriteLine(“Colelement index is =” + colidx);

I have a Website were I want to click a button, but I can’t find in the button in the HTML script, what I have to write in my Python script?
Later I want to have something like

driver.find_element_by_css_selector()

Now I don’t know what I have to put in there

<div class=”custom-col” onclick=”Ajax(‘routes.php’,’main’);mainMenuLoad(‘mainMenuRoutes’);” style=”width: 20%;”>
<img src=”assets/img/icons/route-icon-shade.png” class=”btn-action” id=”mainMenuRoutes” style=”height:40px;”>
</div>

I hope you understood my question because I am not a native speaker

When I hover over login text there are list of links, i need to select Infostore using Page Object model approach. I am new to Selenium could any one help. I have the outer HTML for you:

<div class=”desktop-login”>
LOGIN
<ul class=”no-bullet list-nav-child sub-menu-lv”>
<li class=”nav-child-item”>
<a href=”https://infostore.saiglobal.com/”>Infostore</a>
</li>
</ul>
</div>

How to fetch text for

<h1 _ngcontent-gtj-c13=””> Site-2
<span _ngcontent-gtj-c13=”” class=”seprator”>|</span>
Building-1 <!—-> </h1>

I have used attribute innerhtml,value,outerhtml,javascript
Not able to fetch site name with building name

getting text= Site-2 |
expected = Site-2 | Building-1

Folksm I’m using TestNG 7.5 and Selenium 4.2.2, with IntelliJ and Java 11.
I’ve got all my bits imported and my tests will run individually, but I’m trying to get my setup and cleanup methods to work with the before and after annotations. Here’s a code sample:
public static class RunTest {
WebDriver driver;
WaitUtils waitUtils;
Actions actions;
StateUtils stateUtils;

public RunTest(WebDriver givenDriver){
this.driver = givenDriver;
this.actions = new Actions(givenDriver);
this.waitUtils = new WaitUtils(givenDriver);
this.stateUtils = new StateUtils(givenDriver);
}

@BeforeMethod(alwaysRun = true)
public void login(){
System.out.println(“test_++++++++++++”);
boolean firstLoginPageFound = true;

driver.navigate().to(“http://www.amazon.ca”);
InteractionUtils interactionUtils = new InteractionUtils(driver);
try{
interactionUtils.clickOnElementByXpath(“//div[@class=’nav-bb-right’]/a[text()=’Your Account’]”);
} catch (NoSuchElementException e){
firstLoginPageFound = false;
}

interactionUtils.clickOnElementByXpath(“//span[@id=’nav-link-accountList-nav-line-1′]”);

byte[] decodedBytes = Base64.getDecoder().decode(“”);

waitUtils.waitForVisibilityOfLocator(“//input[@id=’ap_email’]”).sendKeys(new String(decodedBytes));

interactionUtils.clickOnElementByXpath(“//input[@id=’continue’]”);

decodedBytes = Base64.getDecoder().decode(“”);
waitUtils.waitForVisibilityOfLocator(“//input[@id=’ap_password’]”).sendKeys(new String(decodedBytes));

interactionUtils.clickOnElementByXpath(“//input[@id=’signInSubmit’]”);
}

@Test
public void checkLandingPage(){
System.out.println(“REST++++++++++++”);
Assert.assertTrue(stateUtils.verifyElementIsVisible(“//div[@id=’nav-xshop’]//a[contains(@class, ‘nav-a’) and text()=’Buy Again’]”), “Buy again button is missing”);
}

@AfterMethod(alwaysRun = true)
public void cleanUp(){
System.out.println(“BEST++++++++++++”);
driver.close();
}
}

If I run something like:
RunTest test = new RunTest(new SetUpUtils().getDriver());
test.checkLandingPage();

the checkLandingPage method will run, and fail, but the login and cleanup methods won’t run. I’ve tried a few variations on the annotations, but no luck so far.
The imports used are :
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.interactions.Interaction;
import org.openqa.selenium.support.ui.*;
import org.testng.Assert;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;

import java.time.Duration;
import java.util.Base64;

I’m trying to launch a simple web application test using Appium, using AVD. I’m using eclipse, and the android studio emulator. I included all the packages. I would like to make sure about the capabilities I used concerning the device name because in the AVD the device name is: ‘Nexus6API24’ but when I type the command adb devices I’m getting:

List of devices attached:

emulator-5554 device
product:sdk_google_phone_x86
model:Android_SDK_built_for_x86
device:generic_x86

Could someone explain the source error?

This is the java code I used:

package com.example;

import java.net.MalformedURLException;
import java.net.URL;

import org.openqa.selenium.By;
import org.openqa.selenium.Platform;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.remote.BrowserType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

import io.appium.java_client.AppiumDriver;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.remote.MobileCapabilityType;

public class FirstAppiumTest {

// create instance for appium driver
AppiumDriver<WebElement> driver;
@Test

public void Setup() throws MalformedURLException
{
DesiredCapabilities cap = new DesiredCapabilities();
cap.setCapability(MobileCapabilityType.BROWSER_NAME,BrowserType.CHROME);
cap.setCapability(MobileCapabilityType.PLATFORM,Platform.ANDROID);
cap.setCapability(MobileCapabilityType.PLATFORM_NAME,”Android”);
cap.setCapability(MobileCapabilityType.DEVICE_NAME, “emulator-5554”);
//cap.setCapability(“AVD”, “emulator-5554”);
driver = new AndroidDriver<WebElement>(new URL(“http://127.0.0.1:4723/wd/hub”), cap);
driver.get(“http://www.facebook.com”);
System.out.println(“Title “+driver.getTitle());
driver.findElement(By.name(“email”)).sendKeys(“mukesh@gmail.com”);
driver.findElement(By.name(“pass”)).sendKeys(“mukesh_selenium”);
driver.findElement(By.id(“u_0_5”)).click();
driver.quit();

}

}

And I’m getting this error in eclipse ;

[TestNG] Running:
C:UsersghabrAppDataLocalTemptestng-eclipse–1101744164testng-customsuite.xml

[TestNG] Running:
C:UsersghabrAppDataLocalTemptestng-eclipse–1101744164testng-customsuite.xml

Feb 12, 2017 6:26:49 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Attempting bi-dialect session, assuming Postel’s Law holds true on the remote end
Feb 12, 2017 6:26:49 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Attempting bi-dialect session, assuming Postel’s Law holds true on the remote end
FAILED: Setup
org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Requested a new session but one was in progress) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
Build info: version: ‘3.0.1’, revision: ‘1969d75’, time: ‘2016-10-18 09:48:19 -0700’
System info: host: ‘LAPTOP-O6MJ7FC6’, ip: ‘192.168.251.2’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_121’
Driver info: driver.version: AndroidDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:216)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:161)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:64)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:141)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:69)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
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.startSession(RemoteWebDriver.java:241)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:128)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:141)
at io.appium.java_client.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:38)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:90)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:128)
at io.appium.java_client.android.AndroidDriver.<init>(AndroidDriver.java:72)
at com.example.FirstAppiumTest.Setup(FirstAppiumTest.java:33)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:104)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:645)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:851)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1177)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
at org.testng.TestRunner.privateRun(TestRunner.java:756)
at org.testng.TestRunner.run(TestRunner.java:610)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:387)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:382)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
at org.testng.SuiteRunner.run(SuiteRunner.java:289)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1293)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1218)
at org.testng.TestNG.runSuites(TestNG.java:1133)
at org.testng.TestNG.run(TestNG.java:1104)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:236)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:81)
FAILED: Setup
org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Requested a new session but one was in progress) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
Build info: version: ‘3.0.1’, revision: ‘1969d75’, time: ‘2016-10-18 09:48:19 -0700’
System info: host: ‘LAPTOP-O6MJ7FC6’, ip: ‘192.168.251.2’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_121’
Driver info: driver.version: AndroidDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:216)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:168)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:161)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:64)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:141)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:69)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
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.startSession(RemoteWebDriver.java:241)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:128)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:141)
at io.appium.java_client.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:38)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:90)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:128)
at io.appium.java_client.android.AndroidDriver.<init>(AndroidDriver.java:72)
at com.example.FirstAppiumTest.Setup(FirstAppiumTest.java:33)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:104)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:645)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:851)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1177)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112)
at org.testng.TestRunner.privateRun(TestRunner.java:756)
at org.testng.TestRunner.run(TestRunner.java:610)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:387)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:382)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
at org.testng.SuiteRunner.run(SuiteRunner.java:289)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1293)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1218)
at org.testng.TestNG.runSuites(TestNG.java:1133)
at org.testng.TestNG.run(TestNG.java:1104)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:236)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:81)

===============================================
Default test
Tests run: 1, Failures: 1, Skips: 0
===============================================

===============================================
Default suite
Total tests run: 1, Failures: 1, Skips: 0
===============================================

[TestNG] Time taken by org.testng.reporters.jq.Main@82de64a: 38 ms

===============================================
Default test
Tests run: 1, Failures: 1, Skips: 0
===============================================

===============================================
Default suite
Total tests run: 1, Failures: 1, Skips: 0
===============================================

[TestNG] Time taken by org.testng.reporters.jq.Main@82de64a: 38 ms
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@47e2e487: 740 ms
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 20 ms
[TestNG] Time taken by org.testng.reporters.XMLReporter@1151e434: 6 ms
[TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@47e2e487: 740 ms
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 20 ms
[TestNG] Time taken by org.testng.reporters.XMLReporter@1151e434: 6 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter2@4efac082: 480 ms
[TestNG] Time taken by org.testng.reporters.EmailableReporter2@4efac082: 480 ms
[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@13fd2ccd: 17 ms
[TestNG] Time taken by org.testng.reporters.JUnitReportReporter@13fd2ccd: 17 ms

And this is the log messages in Appium :

> info: –> POST /wd/hub/session {“capabilities”:{“desiredCapabilities”:{“browserName”:”chrome”,”platformName”:”Android”,”deviceName”:”emulator-5554″,”platform”:”ANDROID”},”requiredCapabilities”:{}},”desiredCapabilities”:{“browserName”:”chrome”,”platformName”:”Android”,”deviceName”:”emulator-5554″,”platform”:”ANDROID”},”requiredCapabilities”:{}}
> error: Failed to start an Appium session, err was: Error: Requested a new session but one was in progress
> info: Client User-Agent string: Apache-HttpClient/4.5.2 (Java/1.8.0_121)
> 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. : platform
> info: Set mode: Proxying straight through to Chromedriver
> info: [debug] Looks like we want chrome on android
> info: [debug] Creating new appium session 960dfc32-859d-4586-9cc6-6bd96e0e2815
> info: [debug] Checking whether adb is present
> info: [debug] Using adb from C:UsersghabrAppDataLocalAndroidsdkplatform-toolsadb.exe
> info: [debug] Using fast reset? false
> info: [debug] Preparing device for session
> info: [debug] Not checking whether app is present since we are assuming it’s already on the device
> info: Retrieving device
> info: [debug] Trying to find a connected android device
> info: [debug] Getting connected devices…
> info: [debug] executing cmd: C:UsersghabrAppDataLocalAndroidsdkplatform-toolsadb.exe devices
> info: –> POST /wd/hub/session {“capabilities”:{“desiredCapabilities”:{“browserName”:”chrome”,”platformName”:”Android”,”deviceName”:”emulator-5554″,”platform”:”ANDROID”},”requiredCapabilities”:{}},”desiredCapabilities”:{“browserName”:”chrome”,”platformName”:”Android”,”deviceName”:”emulator-5554″,”platform”:”ANDROID”},”requiredCapabilities”:{}}
> info: Client User-Agent string: Apache-HttpClient/4.5.2 (Java/1.8.0_121)
> info: [debug] Error: Requested a new session but one was in progress
> at [object Object].Appium.start (C:Program Files (x86)Appiumnode_modulesappiumlibappium.js:139:15)
> at exports.createSession (C:Program Files (x86)Appiumnode_modulesappiumlibservercontroller.js:188:16)
> at Layer.handle [as handle_request] (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterlayer.js:82:5)
> at next (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterroute.js:110:13)
> at Route.dispatch (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterroute.js:91:3)
> at Layer.handle [as handle_request] (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterlayer.js:82:5)
> at C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterindex.js:267:22
> at Function.proto.process_params (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterindex.js:321:12)
> at next (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterindex.js:261:10)
> at next (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterroute.js:100:14)
> at next (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterroute.js:104:14)
> at next (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterroute.js:104:14)
> at next (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterroute.js:104:14)
> at next (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterroute.js:104:14)
> at next (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterroute.js:104:14)
> at next (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterroute.js:104:14)
> at next (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterroute.js:104:14)
> at next (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterroute.js:104:14)
> at next (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterroute.js:104:14)
> at next (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterroute.js:104:14)
> at next (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterroute.js:104:14)
> at next (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterroute.js:104:14)
> at next (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterroute.js:104:14)
> at next (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterroute.js:104:14)
> at next (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterroute.js:104:14)
> at next (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterroute.js:104:14)
> at next (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterroute.js:104:14)
> at next (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterroute.js:104:14)
> at next (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterroute.js:104:14)
> at next (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterroute.js:104:14)
> at next (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterroute.js:104:14)
> at next (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterroute.js:104:14)
> at next (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterroute.js:104:14)
> at next (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterroute.js:104:14)
> at C:Program Files (x86)Appiumnode_modulesappiumlibservercontroller.js:39:7
> at Layer.handle [as handle_request] (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterlayer.js:82:5)
> at next (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterroute.js:110:13)
> at next (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterroute.js:104:14)
> at Route.dispatch (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterroute.js:91:3)
> at Layer.handle [as handle_request] (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterlayer.js:82:5)
> at C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterindex.js:267:22
> at Function.proto.process_params (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterindex.js:321:12)
> at next (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterindex.js:261:10)
> at methodOverride (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesmethod-overrideindex.js:79:5)
> at Layer.handle [as handle_request] (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterlayer.js:82:5)
> at trim_prefix (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterindex.js:302:13)
> at C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterindex.js:270:7
> at Function.proto.process_params (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterindex.js:321:12)
> at next (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterindex.js:261:10)
> at logger (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesmorganindex.js:136:5)
> at Layer.handle [as handle_request] (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterlayer.js:82:5)
> at trim_prefix (C:Program Files (x86)Appiumnode_modulesappiumnode_modulesexpresslibrouterindex.js:302:13)
> info: [debug] Responding to client with error: {“status”:33,”value”:{“message”:”A new session could not be created. (Original error: Requested a new session but one was in progress)”,”origValue”:”Requested a new session but one was in progress”},”sessionId”:”960dfc32-859d-4586-9cc6-6bd96e0e2815″}
> info: <– POST /wd/hub/session 500 5841.676 ms – 250
> info: [debug] 1 device(s) connected
> info: Found device emulator-5554
> info: [debug] Setting device id to emulator-5554
> info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
> info: [debug] executing cmd: C:UsersghabrAppDataLocalAndroidsdkplatform-toolsadb.exe -s emulator-5554 wait-for-device
> info: [debug] executing cmd: C:UsersghabrAppDataLocalAndroidsdkplatform-toolsadb.exe -s emulator-5554 shell “echo ‘ready'”
> info: [debug] Starting logcat capture
> info: [debug] Pushing unlock helper app to device…
> info: [debug] executing cmd: C:UsersghabrAppDataLocalAndroidsdkplatform-toolsadb.exe -s emulator-5554 install “C:Program Files (x86)Appiumnode_modulesappiumbuildunlock_apkunlock_apk-debug.apk”
> info: [debug] Cleaning up appium session
> error: Failed to start an Appium session, err was: Error: Command failed: Failed to install C:Program Files (x86)Appiumnode_modulesappiumbuildunlock_apkunlock_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.unlock without first uninstalling.]
>
> info: [debug] Error: Command failed: Failed to install C:Program Files (x86)Appiumnode_modulesappiumbuildunlock_apkunlock_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.unlock without first uninstalling.]
>
> at ChildProcess.exithandler (child_process.js:637:15)
> at ChildProcess.EventEmitter.emit (events.js:98:17)
> at maybeClose (child_process.js:743:16)
> at Socket.<anonymous> (child_process.js:956:11)
> at Socket.EventEmitter.emit (events.js:95:17)
> at Pipe.close (net.js:465:12)
> info: [debug] Responding to client with error: {“status”:33,”value”:{“message”:”A new session could not be created. (Original error: Command failed: Failed to install C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.unlock without first uninstalling.]rn)”,”killed”:false,”code”:1,”signal”:null,”origValue”:”Command failed: Failed to install C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.unlock without first uninstalling.]rn”},”sessionId”:null}
> info: <– POST /wd/hub/session 500 26332.143 ms – 642

My Problem

I’m trying to automate a login/logout test to my website using Selenium IDE and I’m facing a problem while trying to verify a value displayed in the page.
In my test I first verify the title of the page using “store title” and then “verify” with the target “title” and the name of my website name in “value” and it works correctly.
However, when I want to verify a random string in my website which is in a span like that I’m facing an issue. (there’s no other way in the website to see the username we used to connect)
<span style=”font-weight:bold;”>admin</span>

I didn’t find anything that could allow me to store the value which is not in the span directly with a tag like “value=admin” or “username=admin” where I could use “store attribute” for example.
What I tried

Also, I tried using the “store text” command using “Select target in page” (it gives me : css=span:nth-child(3)) and then click on the text and associate it with value “admin” but when I try to verify that the target “admin” equals to value “admin” it says : “Actual value ” did not match ‘admin'”
Similar Question

Similar but uses Selenium Webdriver : How can I get the value from span class in selenium?

I am trying to test a standalone application on the Citrix platform using JMeter. I have installed the Citrix receiver as well as the JMeter ICA plugin for the same. But I am not able to launch the Citrix web form through JMeter.

I tried recording the events using Badboy, but the script is erroring out when trying to export to JMeter as it fails to recognize ‘Click’ and ‘Execute’ requests captured in the Badboy script.

Any help on this would be highly appreciated.

While opening JMeter 5.1v in log I came across an issue

i.e WARN o.j.r.Plugin: Unable to load class:
com.atlantbh.jmeter.plugins.oauth.OAuthSampler
java.lang.NoClassDefFoundError:
org/apache/jmeter/protocol/http/sampler/HTTPSampler2 I had added oAuth
sampler plugins in lib/ext also

please suggest me to overcome this issue

I have application which has extension as .msc, I tried it with python
I also ran winappdriver before executing this script. I have seen demo codes on some blogs which uses .exe file extension for the app like calculator or notepad, but nothing around .msc. And similar question around this same problem is unanswered here https://stackoverflow.com/questions/67823892/appium-winappdriver-unable-to-automate-jnlp-applications-the-specified-exec
Like
import time
from appium import webdriver

desired_caps = {}
desired_caps[“app”] = “C:\Desktopvit extendedvit.msc”
desired_caps[“platformName”] = “Windows”

driver = webdriver.Remote(“http://127.0.0.1:4723”, desired_caps)

time.sleep(4)

Earlier I was getting below error but got rid of this when I added additional capabilities as appWorkingDir and deviceName-

Failed to locate opened application window with appId “xxx” and process “xxx”

but now stumbled upon getting this error –

The specified Executable is not a valid application for this OS Platform

I’m using Selenium in my Groovy application as a Maven dependency. Now I’m looking for a way to log the used Selenium Version to the console.
I tried this:
BuildInfo info = new BuildInfo();
def infoString = info.toString();

But infoString only contains:
“Build info: version: ‘unknown’, revision: ‘unknown’, time: ‘unknown'”.
I also tried reading the version from the classpath of the project and though this works in a Java project in a groovy project the classpath no longer contains the used selenium version.
In a java project, the infoString also contains the used version, revision etc.
Any help would be very much appreciated!

I am working on a mobile project, but I got stuck with it, as I cannot Locate any element for this Login pop-up Box through UIAutomator Viewer, the only elements being displayed by the UIAutomator viewer are the web Elements that are beneath the Login pop-up box.

How can I go about identifying the Username, Password input boxes, Sign In button and any other element(s) on this Login pop-up box.

I wonder if there is a way to assert that XML response does NOT contain any other tags than those expected?
I am using plain http requests (no WSDL, schema validation, not SOAP, not REST) and the application protocol is custom for a particular application (POS systems).

I was thinking (and started) of creating a custom SOAPUI library with script that contains:

a reference table
a function that checks if returned tag is on the list (in reference table)

if the returned tag is not on the list, then assertion fails

So, my question is: is there a better way to validate that?
The response XMLs have a lot of fields, some mandatory, some optional and some conditional depending on other (within same request).

While testing Hybrid android app in Appium, a change of context from NATIVE to WEBVIEW is expected. But, the name of the WEBVIEW context does not remain same at all instance of testing. However, it is one of the follwing:

WEBVIEW_undefined
WEBVIEW_{package_name_of_application_under_test}

Say, I’m testing a Hybrid app with package name

com.webviewbrowser

In this case, the context name of the WEBVIEW switches randomly between the following two at every instance

WEBVIEW_undefined
WEBVIEW_com.webviewbrowser

When I use the following in my code,
driver.context(“WEBVIEW_com.webviewbrowser”)

Miserably, I actually receive the context name WEBVIEW_undefined sometimes and NosuchContextException is thrown.
Why does this happen even when no other app is running at the time of testing?
How do I get rid of this issue?

I’m testing a web application in which all web controls are loaded dynamically using AJAX. I have a test script project in java Eclipse IDE.

Here is my problem. If, for example, I am debugging a test script for my last module, I have to go through all my dependent modules first and execute each one’s script before I can debug my last module. It is a very time consuming and boring task to execute the scripts for previous modules every time.

Is there a way I can bypass my dependent module test script execution in Eclipse?

I’m starting to get frustrated with Chrome emulator:
Using JAVA + Selenium + TestNG I’m testing many of our web applications which runs on few browsers. On mobile browser we have a special design – and NOW i’m trying to test it with the Chrome emulator but without great success. I can only load a page and check the elements, BUT I CAN’T click() on it (or other interactions with Actions object).

I’ve tried a simple :

someElement.click()

and

Actions action = new Actions(driver);
action.moveToElement(someElement).click().build().perform();

and both doesn’t work. The run just stays there until the test case gets time out.

Any ideas?
Thanks

I’m writing automation script for a page in which there is a text box. The scenario is as follows:

I click on the text box and enter a value which will throw error
I clear the text box and add valid value and click on confirm button
Then I see the answer provided in the text box as an answer bubble
I click on the edit button to change the answer bubble back into text box
I clear the text box and add new value

In the last step where I need to clear and add new value to the text box, what happens is that the text box is not cleared even when the code is there to clear it. In step 2 it does clear the text box.
public void enterElectricityReading(String electricReading) {
WebDriverWait wait = new WebDriverWait(driver, 60);
wait.until(ExpectedConditions.elementToBeClickable(electricityField));
electricityField.clear();
electricityField.sendKeys(electricReading);
}

Can someone help me to understand why does the clear code is not run and value is not cleared?
At a certain period when the test is run then the clear method works. But it is not reliable.

Precondition: Need To Login Application first, then I can send my API request to the server, so who can set this thing in Jmeter?

Current: I am getting error as

“{“Message”:”Request was not made within the context of a valid
session.”,”Data”:”ErrorId: “}”

I am repeatedly getting a very annoying problem when automating my test cases using Selenium/C# in Visual Studio.

This test is designed around validating search criteria text. In order for me to test each criteria, I have to:

Navigate to the the app’s homepage
Click on the search app
On the search page, enter valid criteria
On the search results page, assert that the search criteria appears in text as what was searched for.
Repeat steps 1-3 with different search criteria.
Verify all search criterias on the results page appear as they should.

When I get to step 5 (navigating back to the homepage), I get the following exception:
“threw exception:
OpenQA.Selenium.StaleElementReferenceException: Element is no longer valid”

I had gotten this before and got around it by adding a “wait.Until(ExpectedConditions.ElementIsVisible” command- not entirely sure why this worked.

However, the above solution is becoming very tedious as it requires me to enter an instance for EACH element that I call to, which will end up being x30 more.

Any help will be greatly appreciated.