Python noobin’

Ya, I’m a python noob.  Thanks to mdas and njpark I learned about import pdb.

Basically I placed an import pdb line at the top and pdb.set_trace() where I want to stop.  ( see might be helpful, especially the section 26.3 )

import pdb

from gaiatest import GaiaTestCase
from import Search
from gaiatest.apps.system.regions.activities import Activities
from gaiatest.apps.system.regions.cards_view import CardsView

class TestBrowserWindows(GaiaTestCase):

    def setUp(self):
        self.apps.set_permission_by_url(Search.manifest_url, 'geolocation', 'deny')

        self.test_url = self.marionette.absolute_url('mozilla.html')

    def test_browser_menu_windows(self):
        search = Search(self.marionette)
        browser = search.go_to_url(self.test_url)

        activities = Activities(self.marionette)


        cardsview = CardsView(self.marionette)

This way I can debug my code, using commands such as:


ie. I can do something like browser.__dict__ or dir(browser)

It helped out a lot.

PS : I really ❤ Pycharm


About shizen008

Breaking things and getting in trouble for it since '74. Disclaimer: I am not responsible if I make your head explode reading this blog! The writings here are my own expression and not of any companies. I currently work on being a QA for B2G aka Firefox OS
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s