Safari 13.1.1 history, website data and cache cleaning with a single script - cookies

Hello dear Stackoverflow community,
I am looking in vain for an applescript with which I can delete the history, the website data, the cookies and the cache in my Safari browser 13.1.1. Unfortunately I only find scripts for older browser versions.
So far I've been experimenting with the following script only for the website data, but it may not work:
tell application "System Events" to tell process "Safari"
keystroke "," using command down
delay 1
click button "Privacy" of toolbar 1 of window 1
click button "Manage Website Data…" of group 1 of group 1 of window "Privacy"
delay 3
click button "Remove All"
click button "Done"
end tell
Since I am using the German Safari version, I have replaced the following terms:
"Privacy" → "Datenschutz"
"Manage Website Data…" → "Websitedaten verwalten ..."
"Remove All" → "Alle entfernen"
"Done" → "Fertig"
So my script looks like this:
tell application "System Events" to tell process "Safari"
keystroke "," using command down
delay 1
click button "Datenschutz" of toolbar 1 of window 1
click button "Websitedaten verwalten …" of group 1 of group 1 of window "Datenschutz"
delay 3
click button "Alle entfernen"
click button "Fertig"
end tell
Unfortunately it does not work even then and I assume that this script does not fit for Safari 13.1.1.
Can someone help me here?
However, I have to confess that I am not very well versed in programming.
Kind regards and thank you ever
Andy

Related

How can I Close a popup window, after execute Update SQL. (Oracle APEX 21.1)

I created a pop-up page. That pop-up window has a radio button, a text box, and an execute button. I want to work that page working like... when pressing the button, run a update SQL with the values of the radio button and text box, and close itself.
I tried that answer in the following link. But the pop-up page just reloaded and the page stayed open. How to close popup window in Oracle-apex?
If possible, I would like to validate the value of the text box. If it was an incorrect value then break the process with a message. If path that validation, run a update SQL and close the pop-up window.
Thank you for your kindness for read this confusing question.
You should be using a "Close Dialog" process type after your Save Process.
Make sure that you also set the server side condition accordingly so that the dialog only closes after your save process.
I GOT RESOLVED IT!
Not use any close method, redirect util is fine work like this APEX_UTIL.REDIRECT_URL (APEX_PAGE.GET_URL(p_page => 7));
Thank you to all ppl for look this page :)

How to close window in apex builder on clicking a button

I have an apex page where I have a button "SAVE & CLOSE" . On click of that button, I first want to save the data and then close the page.
I have a PLSQL code at point "Processing" to save the data.
I have then created a Branch at Point = "After Processing" and Type ="PLSQL Procedure" and written below code to close the window.
Begin
htp.p('<script type="text/javascript" >');
htp.p('window.close();');
htp.p('</script>');
end;
I have added the button's name in server side condition : When button Pressed.
But this doesn't work. When I click on apply, it doesn't close the window. It gives me an error :
"Error: SyntaxError: Unexpected token < in JSON at position 0 "
Can you please help me resolve this error and tell how can I close the window in button click.
Thanks,
Abha
You can use only APEX components and not write a single line of code :)
Set action for your button to "Submit page" - so all items will be submitted to use their values in processing. Image below will help you.
Now, for processing your pl/sql code use process in processing(left side on the picture).
Here you can create a new process and set type to "Close dialog" this process will automatically close the window. Without any javascript etc.. Apex is processing from top to bottom, so if you make this process last, it will always close the window after all processes are done.
You can as well set process server side condition, so it will not trigger every time.
Be careful with javascript - some web browsers are processing them in different way.
Hope it will help. Have a nice day !
Hi I got it working with other method :
Instead of type : PLSQL Procedure" select Type = "Page or URL Redirect"
and give
javascript:window.close()
in the Target.
This works.
What I did was make the page Modal. Then I added a Button called btnClosePage with a Dynamic Action (True Event) that calls "Close Dialog". I am working in Oracle Apex 20.2.

Not able to select option from dropdown box in an android mobile application

I have to automate payment gateway process for my native android application for which i have to select option from dropdowon box. After selecting an option "continue" button will be enabled.
On clicking continue button it takes me to new screen where payment details will be entered.
I'm facing following issues:
1) Not able to select drop down menu option after scrolling in the drop drown.
2) Able to select the option from first 5 options which are visible when dropdwon opens without any scrolling.after the option selection continue button has to be enabled by defalut.i am able to see that option got selected but not able to click on continue button.Script is not returning any error but i am sure it is not clicking on continue button.
Before clicking on dropdown id and class of dropdown are packagename;id/statechooser and android.widget.spinner respectively.
After click on dropdown id and class are android:id/text1 and android.widget.Textview.
Below is my code.
#entering Name
self.driver.find_element_by_id('packagename:id/name').send_keys('App Test');
self.driver.keyevent(66)
#entering address line 1
self.driver.find_element_by_id('packagename:id/address_line_1').send_keys('Madison Boulevard')
self.driver.keyevent(66)
self.driver.find_element_by_id('packagename;id/city').send_keys('Madison');
self.driver.find_element_by_id('packagename;id/zip').send_keys('25758');
self.driver.keyevent(66)(#this event for moving to dropdown)
self.driver.keyevent(66)(#this event for opening dropdown)
self.driver.find_element_by_xpath("//android.widget.TextView[#text='Alabama']").click()
self.driver.find_element_by_id('packagename:id/continue_button').click();
Finally I got solution for this. By using python wrapper for UIAUTOMATOR I am able to proceed to next page.I am using down method until the option is visible and then pressing enter to accept it instead of click method. Below is the code.
while(self.d(resourceId="android:id/text1").text!='Hawaii'):
self.d.press('down');
self.d.press('enter')

Dismissing Modal from Script / osx 10.7+ / safari / automator / objective-c

I am trying to give focus to a safari browser modal box and control its input and dismissal.
Example: Navigate to a website, it throws a modal box, is it possible to create an automator workflow or script that will be able to give the modal focus and interact with its content?
TIA,
BK
Try using System Events:
tell application "System Events" to tell process "Safari"
click button "OK" of window 1
end tell
tell application "System Events" to tell process "Safari"
set value of text field 1 of window 1 to "aa"
click button "OK" of window 1
end tell

How to open a new tab in same browser using robot frame work

As far as I know there is no straight keyword to open new tab in selenium2library. I have seen the below code which opens a new tab in IE(default browser)for the given URL
webbrowser.open_new_tab(url)
But I want to write a keyword which opens a new tab on current running browser (it may be any browser).
You can try
Execute Javascript window.open('')
Get Window Titles
Select Window title=undefined
Go To ${URL}
This Code helps to Open New tab in the same browser and collect the Windows Title of all tabs in same browser.
Based on the Window Title name , it identifies the Newly opened tab and launch the URL
You can use the Javascript Keyword
Execute Javascript window.open('NewTabUrl');
Example:
Execute Javascript window.open('https://www.google.com');
It's sloppy, but you can try:
from selenium.webdriver.common.keys import Keys
actions.key_down(Keys.CONTROL)
element.send_keys('t')
actions.key_up(Keys.CONTROL)
I'm not aware of a browser-agnostic method.
After opening a new tab you can change tabs by finding the window handle with driver.window_handles and switching to the appropriate handle: browser.switch_to_window(handle)
You can use an AutoIt Library For Simulating KeyStroke in Robot Frame Work
Import AutoItLibrary
Import Selinium2library
send "^t" Open the New Tab
same way simulate others
Ctrl+Tab – Switch to the next tab – in other words, the tab on the right. (Ctrl+Page Up also works, but not in Internet Explorer.)
Ctrl+Shift+Tab – Switch to the previous tab – in other words, the tab on the left. (Ctrl+Page Down also works, but not in Internet Explorer.)
Ctrl+W, Ctrl+F4 – Close the current tab.
Ctrl+Shift+T – Reopen the last closed tab