Content-Length: 397957 | pFad | http://github.com/LambdaTest/python-selenium-sample/commit/e2b7e8287f581646b8c2319789af8eb8d89c35a5

58 Added fix RTQDT-RMR7Q-B6PSQ-USQKF (#11) · LambdaTest/python-selenium-sample@e2b7e82 · GitHub
Skip to content

Commit e2b7e82

Browse files
authored
Added fix RTQDT-RMR7Q-B6PSQ-USQKF (#11)
1 parent 86e6fc9 commit e2b7e82

File tree

1 file changed

+18
-27
lines changed

1 file changed

+18
-27
lines changed

lambdatest.py

Lines changed: 18 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11

22
import unittest
3-
import time
43
import os
54
from selenium import webdriver
65
from selenium.webdriver.common.by import By
@@ -56,47 +55,39 @@ def test_demo_site(self):
5655

5756
# Url
5857
print('Loading URL')
59-
driver.get("https://stage-demo.lambdatest.com/")
58+
driver.get("https://todo-app.lambdatest.io/index.html")
6059

61-
# Let's select the location
62-
driver.find_element(By.ID, "headlessui-listbox-button-1").click()
63-
location = driver.find_element(By.ID, "Bali")
60+
# Let's click on a element
61+
driver.find_element(By.NAME, "li1").click()
62+
location = driver.find_element(By.NAME, "li2")
6463
location.click()
65-
print("Location is selected as Bali.")
64+
print("Clicked on the second element")
6665

6766
#Take Smart UI screenshot
6867
#driver.execute_script("smartui.takeScreenshot")
6968

70-
# Let's select the number of guests
71-
driver.find_element(By.ID, "headlessui-listbox-button-5").click()
72-
guests = driver.find_element(By.ID, "2")
73-
guests.click()
74-
print("Number of guests are selected.")
69+
# Let's add a checkbox
70+
driver.find_element(By.ID, "sampletodotext").send_keys("LambdaTest")
71+
add_button = driver.find_element(By.ID, "addbutton")
72+
add_button.click()
73+
print("Added LambdaTest checkbox")
7574

76-
# Searching for the results
77-
search = driver.find_element(By.XPATH, "//*[@id='search']")
78-
assert search.is_displayed(), "Search is not displayed"
75+
# print the heading
76+
search = driver.find_element(By.CSS_SELECTOR, ".container h2")
77+
assert search.is_displayed(), "heading is not displayed"
78+
print(search.text)
7979
search.click()
8080
driver.implicitly_wait(3)
8181

82-
# Let's select one of the hotels for booking
83-
reserve = driver.find_element(By.ID, "reserve-now")
84-
reserve.click()
85-
driver.implicitly_wait(3)
86-
proceed = driver.find_element(By.ID, "proceed")
87-
proceed.click()
88-
driver.implicitly_wait(3)
89-
print("Booking is confirmed.")
90-
9182
# Let's download the invoice
92-
download = driver.find_element(By.ID, "invoice")
93-
if (download.is_displayed()):
94-
download.click()
83+
heading = driver.find_element(By.CSS_SELECTOR, ".container h2")
84+
if heading.is_displayed():
85+
heading.click()
9586
driver.execute_script("lambda-status=passed")
9687
print("Tests are run successfully!")
9788
else:
9889
driver.execute_script("lambda-status=failed")
9990

10091

10192
if __name__ == "__main__":
102-
unittest.main()
93+
unittest.main()

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/LambdaTest/python-selenium-sample/commit/e2b7e8287f581646b8c2319789af8eb8d89c35a5

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy