-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGobonyIssue
More file actions
77 lines (44 loc) · 4.01 KB
/
Copy pathGobonyIssue
File metadata and controls
77 lines (44 loc) · 4.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import com.testsigma.customfunc.common.CustomTestStep;
import com.testsigma.customfunc.common.TestsigmaCustomFunctions;
import com.testsigma.customfunc.result.ResultConstants;
import com.testsigma.customfunc.result.TestStepResult;
import io.appium.java_client.AppiumDriver;
public class imagemissing extends TestsigmaCustomFunctions {
@CustomTestStep
public TestStepResult imagemissing() throws InterruptedException {
AppiumDriver ad = (AppiumDriver) driver;
ad.manage().timeouts().implicitlyWait(10,TimeUnit.SECONDS);
ad.findElement(By.xpath("//*[@text='Skip']")).click();
ad.findElement(By.xpath("//android.widget.FrameLayout[@resource-id=\"android:id/content\"]/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.widget.EditText")).click();
ad.findElement(By.xpath("//android.widget.FrameLayout[@resource-id=\"android:id/content\"]/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.widget.EditText")).sendKeys("9911844391");
ad.findElement(By.xpath("//android.widget.FrameLayout[@resource-id=\"android:id/content\"]/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup[2]")).click();
ad.findElement(By.xpath("//android.widget.FrameLayout[@resource-id=\"android:id/content\"]/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.widget.FrameLayout/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.widget.EditText")).sendKeys("8149");
ad.findElement(By.xpath("//android.widget.Button[contains(@text, 'Allow')]")).click();
ad.findElement(By.xpath("//android.widget.Button[@content-desc=\"Search, tab, 2 of 4\"]")).click();
ad.findElement(By.xpath("//android.widget.EditText[@content-desc=\"search_input\"]")).click();
ad.findElement(By.xpath("//android.widget.EditText[@content-desc=\"search_input\"]")).sendKeys("Style Salon");
ad.findElement(By.xpath("//android.view.ViewGroup[@content-desc=\"salon_container\"]/android.view.ViewGroup/android.widget.TextView[1]")).click();
ad.findElement(By.xpath("//android.view.ViewGroup[@content-desc=\"salon_container\"]/android.view.ViewGroup/android.widget.TextView[1]")).click();
TestStepResult result=new TestStepResult();
result.setStatus(ResultConstants.SUCCESS);
result.setMessage("Successfully Executed");
return result;
}
*************//Need to Swipe from Middle to TOP 2 times Via NLP then you can run the postswipe()//****************
@CustomTestStep
public TestStepResult postswipe() throws InterruptedException {
AppiumDriver ad1 = (AppiumDriver) driver;
ad1.findElement(By.xpath("//android.view.ViewGroup[@content-desc=\"search_button\"]/android.widget.TextView")).click();
ad1.findElement(By.xpath("//android.widget.EditText[@content-desc=\"search_input\"]")).sendKeys("Body Bleach");
ad1.findElement(By.xpath("//*[@text='ADD']")).click();
Thread.sleep(10000);
ad1.findElement(By.xpath("//*[@text='Rohit']")).click();
Thread.sleep(20000);
TestStepResult result=new TestStepResult();
result.setStatus(ResultConstants.SUCCESS);
result.setMessage("Successfully Executed");
return result;
}
}