Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selenium 4 and Appium 2 Upgrade #360

Merged
merged 47 commits into from
Jun 24, 2023
Merged

Selenium 4 and Appium 2 Upgrade #360

merged 47 commits into from
Jun 24, 2023

Conversation

vikramvr20
Copy link
Contributor

@vikramvr20 vikramvr20 commented Apr 27, 2023

Description

  • Upgraded selenium version to 4.8.2
  • Upgraded appium version to 8.3.0

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Changes would cause existing functionality to not work as expected
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@CLAassistant
Copy link

CLAassistant commented Apr 27, 2023

CLA assistant check
All committers have signed the CLA.

this.mobileAutomationServerExecutablePath = new File(PathUtil.getInstance().getMobileAutomationServerPath(), "appium");
if (SystemUtils.IS_OS_WINDOWS) {
this.mobileAutomationServerExecutablePath = new File(PathUtil.getInstance().getMobileAutomationServerPath(), "appium.exe");
}
this.serverIpAddress = serverIP();
this.logFilePath = new File(PathUtil.getInstance().getLogsPath() + File.separator + "appium.log");
Integer serverPort = NetworkUtil.getFreePort();
this.serverURL = String.format("http://%s:%d/wd/hub", serverIpAddress, serverPort);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vikramvr20 we need to have Appium server also need to upgraded. jfyi

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vikramvr20 Please confirm and do necessary changes..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PratheepV - Yes that's already been done and discussed the approach with Rajesh and Vikram.

Upgraded Agent version
Changed uiautomator2 apk file version
Upgrading appium client version to 8.4.0
@@ -298,6 +310,12 @@
<artifactId>log4j-api</artifactId>
<version>2.17.1</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this in automator?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting the below error without adding the dependency. Hence added the same.

Screenshot 2023-05-16 at 2 27 43 PM

@@ -9,14 +9,20 @@

package com.testsigma.automator.actions.mobile;


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Format this file, remove unwanted empty lines

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed

@@ -29,7 +38,12 @@ public class SwipeAction extends MobileDriverAction {
public void execute() throws Exception {
PointOption startingPoint = PointOption.point(tapPoints[0].getX(), tapPoints[0].getY());
PointOption endingPoint = PointOption.point(tapPoints[1].getX(), tapPoints[1].getY());
new TouchAction<>(getDriver()).press(startingPoint)
.waitAction(WaitOptions.waitOptions(Duration.ofSeconds(1))).moveTo(endingPoint).release().perform();
PointerInput FINGER = new PointerInput(TOUCH, "finger");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rename the variable FINGER, use camel case

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed.

getDriver().switchTo().activeElement().sendKeys(Keys.RETURN);
log.error("Hide keyboard by switching to active element and clicking enter");
} catch (Exception e) {
log.error("Could not hide keyboard by switching to active element and clicking enter");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log the exception as well. log.error("Could not hide keyboard.....",e);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed

try {
getDriver().findElement(By.xpath("//*[contains(@name, '" + button + "')]")).click();
} catch (Exception e) {
log.error(e, e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

never use log.error(e,e), u cannot search for exception globallky. add some mesningfiul message
log.error("message",e); also do not use e.getMessage() in place of message

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed

@vikramvr20 vikramvr20 requested a review from PratheepV May 18, 2023 15:42
@@ -145,4 +143,16 @@ public void setWebCapabilities(TestDevice testDevice,
public Integrations getLabDetails() throws IntegrationNotFoundException {
return this.integrationsService.findByApplication(Integration.TestsigmaLab);
}

public String getExecutionName(TestPlanResult testPlanDetails) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vikramvr20 can we exclude runId so that we don't need to pollute methods with TestPlanResult as an argument and as its for debugging only I feel its not worth

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed

@@ -1,6 +1,6 @@
server.port=${TESTSIGMA_SERVER_PORT:9090}
server.url=${TESTSIGMA_SERVER_URL:https://local.testsigmaos.com}
server.version=v2.9.1
server.version=v2.9.2
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vikramvr20 can we have the version as 3.0.0 because its major release

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed

vikramvr20 and others added 23 commits May 19, 2023 14:47
Addressing review comments
Changing testsigma java sdk version
upgrading agent version
upgrading agent version
Pointing proxy to staging instance for testing
Added logic to extract uiautomator2 and xcuitest driver from the respective zip files.
Fixed null pointer exception related to wda process.
Addressed review comments.
correcting indentation
Changed testsigma platform url to default.
@PratheepV PratheepV merged commit 842c2b8 into dev Jun 24, 2023
@PratheepV PratheepV deleted the selenium4 branch June 24, 2023 06:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants