Skip to content

Commit d67f9f8

Browse files
authored
Hot fix get text and log msg (#68)
* Enhance get text to match with selenium library * Add log info
1 parent af6fa68 commit d67f9f8

File tree

4 files changed

+5
-2
lines changed

4 files changed

+5
-2
lines changed

PuppeteerLibrary/keywords/browsermanagement.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ def open_browser(self, url, browser="chrome", alias=None, options=None):
3636
| `Open browser` | https://www.w3schools.com/html/html_forms.asp | options=${options} |
3737
3838
"""
39+
self.info(url)
3940
library_context = self.ctx.create_library_context(alias, browser)
4041
self.loop.run_until_complete(library_context.start_server(options))
4142
self.loop.run_until_complete(library_context.create_new_page(options))
@@ -99,6 +100,7 @@ def go_back(self):
99100
@keyword
100101
def go_to(self, url):
101102
"""Navigates the current page to the ``url``"""
103+
self.info(url)
102104
self.loop.run_until_complete(self.get_async_keyword_group().go_to(url))
103105

104106
@keyword

PuppeteerLibrary/keywords/formelement.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def input_text(self, locator, text, clear=True):
2323
| `Input Text` | id:username | john | True |
2424
2525
"""
26+
self.info(text)
2627
self.loop.run_until_complete(self.get_async_keyword_group().input_text(locator, text, clear))
2728

2829
@keyword

PuppeteerLibrary/playwright/async_keywords/playwright_element.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ async def element_should_not_contain(self, locator: str, expected: str, ignore_c
100100

101101
async def get_text(self, locator: str):
102102
element = await self.library_ctx.get_current_page().querySelector_with_selenium_locator(locator)
103-
return (await (await element.getProperty('textContent')).jsonValue())
103+
return (await (await element.getProperty('innerText')).jsonValue())
104104

105105
async def get_attribute(self, locator: str, attribute: str) -> str:
106106
element = await self.library_ctx.get_current_page().querySelector_with_selenium_locator(locator)

PuppeteerLibrary/puppeteer/async_keywords/puppeteer_element.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ async def element_should_not_contain(self, locator: str, expected: str, ignore_c
9494

9595
async def get_text(self, locator: str):
9696
element = await self.library_ctx.get_current_page().querySelector_with_selenium_locator(locator)
97-
return (await (await element.getProperty('textContent')).jsonValue())
97+
return (await (await element.getProperty('innerText')).jsonValue())
9898

9999
async def get_attribute(self, locator: str, attribute: str) -> str:
100100
element = await self.library_ctx.get_current_page().querySelector_with_selenium_locator(locator)

0 commit comments

Comments
 (0)