Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'PuppeteerLibrary' object has no attribute 'get_current_page' #135

Closed
v8sharma opened this issue Oct 27, 2021 · 1 comment · Fixed by #136
Closed

AttributeError: 'PuppeteerLibrary' object has no attribute 'get_current_page' #135

v8sharma opened this issue Oct 27, 2021 · 1 comment · Fixed by #136

Comments

@v8sharma
Copy link

v8sharma commented Oct 27, 2021

Robot Framework Puppeteer Library: 3.1.0

Open Browser ${URL} browser=ptchrome
${Location} Get Location
${Title} Get Title

When calling keywords Get Title or Get Location I'm getting the following error:

AttributeError: 'PuppeteerLibrary' object has no attribute 'get_current_page'

Traceback (most recent call last):
File "C:\Python37\lib\site-packages\PuppeteerLibrary_init_.py", line 200, in run_keyword
return DynamicCore.run_keyword(self, name, args, kwargs)
File "C:\Python37\lib\site-packages\PuppeteerLibrary\base\robotlibcore.py", line 88, in run_keyword
return self.keywords[name](*args, **kwargs)
File "C:\Python37\lib\site-packages\PuppeteerLibrary\keywords\browsermanagement.py", line 98, in get_location
return self.ctx.get_current_page().url
File "C:\Python37\lib\site-packages\PuppeteerLibrary\base\robotlibcore.py", line 71, in getattr
.format(type(self).name, name))

@v8sharma
Copy link
Author

v8sharma commented Oct 27, 2021

Possible fix is to change line 92 to the following.

return await self.ctx.get_current_library_context().get_current_page().title()

Change line 98 to https://github.com/qahive/robotframework-puppeteer/blob/fba8f5c71dcec0a778a9ed22129bf1dc5e8ef1c3/PuppeteerLibrary/keywords/browsermanagement.py#L98 to the following:

return self.ctx.get_current_library_context().get_current_page().url

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant