Question for Andrew
Posted: Fri Jul 16, 2010 12:57 am
Hi Andrew,
I apologize in advance for asking you for more help but as I come back to the problem that has been haunting me for months, I find that the advice and examples you have given me in the past have been most helpful. The problem for me is still accessing data found on web pages that require logon. You gave me an example of code of a login situation that you had created. Here is the code for the mouseUp that you gave me?
I have made a modification of that code to get to the web page I want. It looks like the following:
What I can't seem to accomplish is the 'click'. Each of the lines that are commented out have been tried but I never get to the next page. As you can see I have been stabbing in the dark a bit. Since the button that I want to click does not seem to have an ID I can't make getElementById to work.
If I put break points at the line I want to test and at the revBrowserClose command I can see that the fields for user name and passwword get filled. I get no error messages when the test line executes but I do not advance to the next page. If I abort the script at the last break point I can manually press the 'Go !' button and get to where I want to be.
Do you have any ideas or suggestions?
I would greatly appreciate them.
Regards,
Larry
I apologize in advance for asking you for more help but as I come back to the problem that has been haunting me for months, I find that the advice and examples you have given me in the past have been most helpful. The problem for me is still accessing data found on web pages that require logon. You gave me an example of code of a login situation that you had created. Here is the code for the mouseUp that you gave me?
Code: Select all
on mouseUp
local tBrowserId
put revBrowserOpen(the windowId of this stack, "http://buriedtreasure.com.au/fakesecure.php") into tBrowserId
revBrowserSet tBrowserId, "rect", "0,0,800,800"
if tBrowserId is not an integer then answer "Failed to open browser"
wait 10 seconds
-- populate fields
get revBrowserExecuteScript(tBrowserId, "document.form1.user.value = 'demoUser';")
get revBrowserExecuteScript(tBrowserId, "document.form1.pwd.value = 'demoPassword';")
get revBrowserExecuteScript(tBrowserId, "document.getElementById('submit').click();")
end mouseUp
I have made a modification of that code to get to the web page I want. It looks like the following:
Code: Select all
on mouseUp
local tBrowserId
put revBrowserOpen(the windowId of this stack, "http://www.petfinder.com/admin") into tBrowserId
revBrowserSet tBrowserId, "rect", "20,0,400,400"
if tBrowserId is not an integer then answer "Failed to open browser"
wait 10 seconds
-- populate fields
get revBrowserExecuteScript(tBrowserId, "document.frm_login.username.value = 'myName';")
get revBrowserExecuteScript(tBrowserId, "document.frm_login.password.value = 'myPassword';")
-- get revBrowserExecuteScript(tBrowserId, "document.getElementById('submit').click();")
-- get revBrowserExecuteScript(tBrowserId, "document.getElementByType('submit').click();")
-- get revBrowserExecuteScript(tBrowserId, "document.getElementByTagName('sign_in').click();")
-- get revBrowserExecuteScript(tBrowserId, "document.getElementByTabIndex('3').click();")
-- get revBrowserExecuteScript(tBrowserId, "document.getElementByValue('GO !').click();")
revBrowserClose tBrowserId
end mouseUp
If I put break points at the line I want to test and at the revBrowserClose command I can see that the fields for user name and passwword get filled. I get no error messages when the test line executes but I do not advance to the next page. If I abort the script at the last break point I can manually press the 'Go !' button and get to where I want to be.
Do you have any ideas or suggestions?
I would greatly appreciate them.
Regards,
Larry