Quantcast
Channel: Active questions tagged selenium - Stack Overflow
Viewing all articles
Browse latest Browse all 98820

Call for global variable in JS block of Selenium Webdriver test (Python)

$
0
0

I have a string of numbers set by user. Defined in the beginning of the Webdriver test:

numbers = input("prompt")

Then I need to enter value of this variable by JS code like this:

driver.execute_script("document.getElementsByName('phone')[0].value=***")

Where instead of *** I need the value of "numbers" variable. How should I properly insert it to make it work?


Viewing all articles
Browse latest Browse all 98820

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>