Skip to content

Commit

Permalink
Fix log obj issue (#341)
Browse files Browse the repository at this point in the history
* Resolving issue with write method filing due to log obj missing issue

* Updation BrowserStack upload url

* Removing commented code

* Updating some typos
  • Loading branch information
avinash010 committed Jul 27, 2023
1 parent c544949 commit 17b9d60
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions page_objects/Base_Page.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,8 @@ def set_directory_structure(self):
if not os.path.exists(self.logs_parent_dir):
os.makedirs(self.logs_parent_dir)
except Exception as e:
self.write("Exception when trying to set directory structure")
self.write(str(e))
self.exceptions.append("Error when setting up the directory structure")
# Using print as log_obj wouldnt be created to write this exception to log file
print("Exception when trying to set screenshot directory due to error:",str(e))


def set_screenshot_dir(self,os_name,os_version,browser,browser_version):
Expand Down
2 changes: 1 addition & 1 deletion page_objects/driverfactory.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ def browserstack_mobile(self, app_path, app_name, desired_capabilities, username
def print_exception(exception, remote_flag):
"""Print out the exception message and suggest the solution based on the remote flag."""
if remote_flag.lower() == 'y':
solution = "It looks like you are trying to use a cloud service provider(BrowserStack or Sauce Labs) to run your test. \nPlease make sure you have updated ./conf/remote_credentials.py with the right credentials and try again. \nTo use your local browser please run the test with the -M N flag"
solution = "It looks like you are trying to use a cloud service provider(BrowserStack or Sauce Labs) to run your test. \nPlease make sure you have updated ./conf/remote_credentials.py with the right credentials and also check for BrowserStack upload url changes and try again. \nTo use your local browser please run the test with the -M N flag"
else:
solution = "It looks like you are trying to run test cases with Local Appium Setup. \nPlease make sure to run Appium Server and try again."

Expand Down
2 changes: 1 addition & 1 deletion page_objects/drivers/remote_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def browser_stack_upload(app_name, app_path):
#Upload the apk
apk_file = os.path.join(app_path, app_name)
files = {'file': open(apk_file, 'rb')}
post_response = requests.post("https://api.browserstack.com/app-automate/upload",
post_response = requests.post("https://api-cloud.browserstack.com/app-automate/upload",
files=files, auth=(username, access_key))
post_json_data = json.loads(post_response.text)
#Get the app url of the newly uploaded apk
Expand Down

0 comments on commit 17b9d60

Please sign in to comment.