I am trying to do the following in Safari: I have a website opened (let's say http://www.example.org) and I'm trying to get the current tab by using applescript.
I tried the following:
delay 1
tell application "Safari"
set mytitle to name of current tab in window 1
end tell
display alert mytitle
However I get the following error message
Safari got an error: AppleEvent handler failed.
I tried with all sorts of variations, URL of current tab in window 1, name of current tab, with and without window 1...
But the error persists.
After a bit of consoling it came up with this error:
Console returns this: Error while returning the result of a script command: the result object... lol - Buscar con Google ...could not be converted to an Apple event descriptor of type 'text'. This instance of the class '__NSCFString' returned nil when sent -objectSpecifier (is it not overridden?) and there is no coercible type declared for the scripting class 'text'.
What am I doing wrong?
I'd appreciate any ideas.
Thanks.
Try:
tell application "Safari"
set mytitle to name of current tab in window 1
end tell
return mytitle
The first script I posted did indeed work... There was a systemwide error and clean install fixed it. Not sure what was going on. Thanks everyone.
Related
I am getting an error "Value cannot be null,parameter name: s" after setting password through selenium script and clicking submit button.
Please help me on this, Thanks
Am using the below code for setting password
var passwordtxt=driver.FindElement(By.Id("txtpassword"));
var JSexecutor= (IJavaScriptExecutor)driver;
JSexecutor.ExecuteScript("arguments[0].setAttribute('value', arguments[1])",passwordtxt,"mypassword");
Based on the error message you provided, it sounds like the item passwordtxt doesn't exist on the page. Value cannot be null is referring to the element you pass into ExecuteScript, which is passwordtxt in this case.
To solve this problem, you will need to change the way you are finding passwordtxt. If you post some more HTML from your page's source, we can help you determine the correct selector to use.
I am unable to scroll down to the save button at the end of the page. Have tried using scrollToElement function but it does not work.
The error given :
Test Cases/merchantAdd1 FAILED because (of) groovy.lang.MissingMethodException: No signature of method: static com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.scrollToElement() is applicable for argument types: (com.kms.katalon.core.testobject.TestObject)
This doesn't necessarily mean you are unable to scroll to an element. You are missing a parameter.
The error message is saying you are trying to pass the wrong types of argument to scrollToElement() function. It is expecting a TestObject and an int (timeout in seconds) and you are passing in only the test object.
It should be something like
WebUI.scrollToElement(findTestObject('your test object'), 3)
If you are unable to find Test Object, and it is at the bottom of the page, try scrolling to position high absisse and ordinate.
for example WebUI.scrollToPosition(9999999, 9999999)
Then try click on the Objct
I'm having an issue where I've got a button that's action is to 'submit page' upon being clicked. The code then executes a PL SQL statement:
IF :REQUEST = 'btn_create_company' THEN
INSERT INTO COMPANIES (company_name) VALUES(:COMPANY_NAME);
However, when the code comes to execute, whilst it is adding the entry to the database, I'm getting this error on the client which is preventing the page from redirecting after processing:
Error: SyntaxError: Unexpected end of JSON input
I don't understand why this is happening as I'm confident there's nothing wrong with the above statement.
Ok, so I get this problem too, It's when I submit the page but instead of reload the whole page, I'm running a process and stay there.
The process itself works well, however I get the error message, just like you.
So I don't get the a solution, but found a workaround by adding this to the end of my process:
apex_json.open_object;
apex_json.write('success', true);
apex_json.close_object;
You are missing the page number on :COMPANY_NAME. It should be something like :P1_COMPANY_NAME
I was encountering a similar error when operating the last page in a chained dialog (aka "wizard") I had created.
The cause of my issue was that I had created a branch on the "After Submit" with the Behaviour/Type attribute set to "PL/SQL Procedure" and then had the code I wanted to be executed within the PL/SQL code attribute. When the "Finish" button was clicked, I was seeing the same error.
My resolution was to delete the branch and instead to use Create Process, with the Identification/Type set to "PL/SQL Code" and then placing the code I wanted to be executed within the "Source/PL/SQL Code" attribute.
I'm tring to put facebook Like Box to my blog but after I put Javascript SDK (right after opening body it show me error
**
The reference to entity "appId" must end with the ';' delimiter.
**
and I cant fix it ... :(
What I need to do/edit ???
I had the same problem: fbml=1 appId where I just deleted & and put the closing script right after Load the SDK line. I checked it with the debugger and now there are no errors.
I'm not asking for other permissions, just the "like my page."
{edit. had to change to closing script as the brackets and script didn't show.
Yes, Change the &appId to &appId ant it will work.
I have found out my issue on the device not working and simulator working.
When i comment out this part, it works:
[OpenFeint initializeWithProductKey:#"MYKEY" andSecret:#"MYSECRET" andDisplayName:#"LatinToGo" andSettings:settings andDelegates:[OFDelegatesContainer containerWithOpenFeintDelegate:self]];
So it looks like this:
//[OpenFeint initializeWithProductKey:#"MYKEY" andSecret:#"MYSECRET" andDisplayName:#"LatinToGo" andSettings:settings andDelegates:[OFDelegatesContainer containerWithOpenFeintDelegate:self]];
it works perfectly when I comment out that part above, but when I click the open feint button, I get this error:
EXC_BAD_ACCESS.
I replace My key with my app Key in open feint and my secret with my app's secret code.
When I click the open feint button, it goes to a file and highlights this part in GREEN:
[inv invoke]; EXC_BAD_ACCESS
Then in my console when i Step into:
2012-04-28 08:53:12.076 BalloonsPop[500:707] Application windows are expected to have a root view controller at the end of application launch
Single stepping until exit from function +[OpenFeint(Private) launchDashboardWithDelegate:tabControllerName:andControllers:],
which has no line number information.
warning: Remote failure reply: E37
Any Suggestions to try?
Thanks A lot!
I am not sure if you do, but I would declare it like this:
OpenFeint *openfeint = [OpenFeint initializeWithProductKey:#"MYKEY"
andSecret:#"MYSECRET" andDisplayName:#"LatinToGo" andSettings:settings
andDelegates:[OFDelegatesContainer containerWithOpenFeintDelegate:self]];
I hope this helps.