3

I have the problem of running this. I get back an error stating that I either am missing a ) after arguments or that I have an illegal character. I understand that it must be thinking that I am trying to insert an argument when I am not. I believe I just need help with the syntax.

 browser.execute_script("url = '/Administration/SwitchCompany?' + jQuery.param({CompanyId: $('#companyDropDownList option:contains('DTLTest')').val() })")
browser.execute_script("$('#userInfoPlaceholder').load(url, switchCompanyCallback);" )
asked Aug 8, 2014 at 18:00

2 Answers 2

4

Did you mean

browser.execute_script("$('#userInfoPlaceholder').load(url, switchCompanyCallback);" )

Change of # to $

answered Aug 8, 2014 at 18:02
Sign up to request clarification or add additional context in comments.

1 Comment

that was a mistake writing it into the forum. But in my code that is not there. Still doesn't work
0

You have single quotes inside of single quotes in your javascript:

$('#companyDropDownList option:contains('DTLTest')')

If you switch the quotes around the full Python string to triple quotes, you could use both single and double quotes in your javascript. Otherwise, you'll need to do some escaping.

answered Aug 9, 2014 at 4:59

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.