Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

THis is a repost of an earlier question that was not fully answered. When I run the code it does not date as February 3,

THis is a repost of an earlier question that was not fully answered. When I run the code it does not date as February 3, 2018 3:15:28 Am , the program is still displaying the March 1, 2018 date and time that is displayed in the "html" file.

Declare a variable named thisTime containing a Date object for February 3, 2018 at 3:15:28 AM. Use the toLocaleString() method to save the text of the thisTime variable in the timeStr variable. Change the inner HTML code of the page element with the ID timestamp to the value of the timeStr variable.

Next, you will determine which sky map to show in the web page. First, create a variable named thisHour, using the getHours() method to extract the hour value from the thisTime variable. Create a variable named thisMonth using the getMonth() method to extract the month number from the thisTime variable.

THIS IS THE ERROR I AM GETTING:

elm = driver.find_element_by_css_selector('#timeStamp') assert elm.text.find('February 3, 2018 3:15:28 AM') != -1, "The element with id 'timeStamp' should display the string 'February 3, 2018 3:15:28 AM'. Found '" + elm.text + "' instead."

HERE IS THE CODE I AM WORKING WITH: