Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a7094ea

Browse filesBrowse files
authored
Added passfail check
1 parent 61c3b9f commit a7094ea
Copy full SHA for a7094ea

File tree

Expand file treeCollapse file tree

1 file changed

+11
-8
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+11
-8
lines changed

‎README.md

Copy file name to clipboardExpand all lines: README.md
+11-8Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# How to change IP geographic location in Python with Appium on on [LambdaTest](https://www.lambdatest.com/?utm_source=github&utm_medium=repo&utm_campaign=appium-python-geoLocation)
1+
# How to mark test as Passed or Failed in Python with Appium on [LambdaTest](https://www.lambdatest.com/?utm_source=github&utm_medium=repo&utm_campaign=appium-python-passfail)
22

3-
While performing app automation testing with appium on LambdaTest Grid, you may face a scenario where you would like to simulate location of a specific country. You can easily do that by using the lambdatest capability "GeoLocation" and refer the 2-letter country code in the automation script. You can refer to sample test repo [here](https://github.com/LambdaTest/LT-appium-python)
3+
While performing app automation testing with appium on LambdaTest Grid, you may face a scenario where a test that you declared as fail in your local instance may turn out to be completed successfully at LambdaTest. Don't worry though! We understand how imperative it is to flag an app automation test as either "pass" or "fail" depending upon your testing requirement with respect to the validation of expected behaviour. You can refer to sample test repo [here](https://github.com/LambdaTest/LT-appium-python).
44

55
# Steps:
66

7-
The following is an example on how to set geoLocation in the capabilities.
7+
You can specify a test as passed or failed by Lambda hooks. The following is an example on how to set test result as passed or failed. If the code reaches exception, then it will be marked as failed, else as passed.
88

99
```
1010
from appium import webdriver
@@ -26,9 +26,6 @@ desired_caps = {
2626
"visual":True,
2727
"video":True,
2828
29-
#ADD GEOLOCATION BASED ON COUNTRY CODE
30-
"geoLocation":"fr"
31-
3229
}
3330
3431
def startingTest():
@@ -58,9 +55,15 @@ def startingTest():
5855
geolocation = WebDriverWait(driver,20).until(EC.element_to_be_clickable((MobileBy.ID,"com.lambdatest.proverbial:id/geoLocation")))
5956
geolocation.click()
6057
time.sleep(5)
61-
58+
59+
#MARKING TEST AS PASSED
60+
driver.executeScript("lambda-status=passed")
6261
driver.quit()
62+
6363
except:
64+
65+
#MARKING TEST AS FAILED
66+
driver.executeScript("lambda-status=failed")
6467
driver.quit()
6568
6669
startingTest()
@@ -122,4 +125,4 @@ To stay updated with the latest features and product add-ons, visit [Changelog](
122125
## We are here to help you :headphones:
123126

124127
* Got a query? we are available 24x7 to help. [Contact Us](support@lambdatest.com)
125-
* For more info, visit - [LambdaTest](https://www.lambdatest.com/?utm_source=github&utm_medium=repo&utm_campaign=appium-python-geolocation)
128+
* For more info, visit - [LambdaTest](https://www.lambdatest.com/?utm_source=github&utm_medium=repo&utm_campaign=appium-python-passfail)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.