Skip to content

Commit 3b029ee

Browse files
iframe content added
1 parent 1be5e27 commit 3b029ee

File tree

4 files changed

+38
-1
lines changed

4 files changed

+38
-1
lines changed

Data/DynamicData/amazon_book_search_result_dynamic.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,35 @@ amazon_product_description: "Product description\nReview\n\"[Hosanagar's] 'predi
3737
\ and executive education clients include Google, American Express, Citigroup and\
3838
\ SunTrust Bank. Hosanagar earned his PhD in Management Science and Information\
3939
\ Systems from Carnegie Mellon University.\nSee all Product description"
40-
amazon_product_detail_description: ''
40+
amazon_product_detail_description: 'A Wharton professor and tech entrepreneur examines
41+
how algorithms and artificial intelligence are starting to run every aspect of our
42+
lives, and how we can shape the way they impact us
43+
44+
45+
Through the technology embedded in almost every major tech platform and every web-enabled
46+
device, algorithms and the artificial intelligence that underlies them make a staggering
47+
number of everyday decisions for us, from what products we buy, to where we decide
48+
to eat, to how we consume our news, to whom we date, and how we find a job. We''ve
49+
even delegated life-and-death decisions to algorithms--decisions once made by doctors,
50+
pilots, and judges. In his new book, Kartik Hosanagar surveys the brave new world
51+
of algorithmic decision-making and reveals the potentially dangerous biases they
52+
can give rise to as they increasingly run our lives. He makes the compelling case
53+
that we need to arm ourselves with a better, deeper, more nuanced understanding
54+
of the phenomenon of algorithmic thinking. And he gives us a route in, pointing
55+
out that algorithms often think a lot like their creators--that is, like you and
56+
me.
57+
58+
59+
Hosanagar draws on his experiences designing algorithms professionally--as well
60+
as on history, computer science, and psychology--to explore how algorithms work
61+
and why they occasionally go rogue, what drives our trust in them, and the many
62+
ramifications of algorithmic decision-making. He examines episodes like Microsoft''s
63+
chatbot Tay, which was designed to converse on social media like a teenage girl,
64+
but instead turned sexist and racist; the fatal accidents of self-driving cars;
65+
and even our own common, and often frustrating, experiences on services like Netflix
66+
and Amazon. A Human''s Guide to Machine Intelligence is an entertaining and provocative
67+
look at one of the most important developments of our time and a practical user''s
68+
guide to this first wave of practical artificial intelligence.'
4169
amazon_product_details: 'Product details
4270
4371
Hardcover: 272 pages

Library/driver.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,12 @@ def switch_to_new_tab(self):
7171
list_of_window_handles.remove(self.current_window_handle)
7272
self.driver.switch_to.window(list_of_window_handles.pop())
7373

74+
def switch_to_frame(self, locator):
75+
self.driver.switch_to.frame(locator)
76+
77+
def switch_to_default_content(self):
78+
self.driver.switch_to.default_content()
79+
7480
def window_handles_count(self):
7581
return len(self.driver.window_handles)
7682

Locators/amazon_product_page.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ class AmazonProductPageLocator:
1010
amazon_product_title = Locator("css selector", "span#productTitle")
1111
amazon_product_byline_info = Locator("css selector", "div#bylineInfo")
1212
amazon_product_formats = Locator("css selector", "div#formats")
13+
amazon_product_detail_description_iframe = Locator("css selector", "iframe#bookDesc_iframe")
1314
amazon_product_detail_description = Locator("css selector", "div#iframeContent")
1415
amazon_product_offers = Locator("css selector", "div#sopp_feature_div")
1516
amazon_product_description = Locator("css selector", "div#productDescription_feature_div.a-row")

Tests/amazon.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,11 @@ def test_amazon_book_search_001():
9292
ui_dynamic_data["amazon_product_byline_info"] = AmazonProductPage.amazon_product_byline_info.texts_as_string()
9393
AmazonProductPage.amazon_product_formats.scroll_to_locator()
9494
ui_dynamic_data["amazon_product_formats"] = AmazonProductPage.amazon_product_formats.texts_as_string()
95+
driver.switch_to_frame(AmazonProductPage.amazon_product_detail_description_iframe.get_element())
9596
AmazonProductPage.amazon_product_detail_description.scroll_to_locator()
9697
ui_dynamic_data["amazon_product_detail_description"] = AmazonProductPage.\
9798
amazon_product_detail_description.texts_as_string()
99+
driver.switch_to_default_content()
98100
AmazonProductPage.amazon_product_offers.scroll_to_locator()
99101
ui_dynamic_data["amazon_product_offers"] = AmazonProductPage.amazon_product_offers.texts_as_string()
100102
AmazonProductPage.amazon_product_description.scroll_to_locator()

0 commit comments

Comments
 (0)