Issue: Unable to select an element id object using a stored variable.
Situation: I need to open a page, make a selection, store that selection in a variable card_id and next, find the element on the last page with the id pick_id and the stored variable, and click it. Hope I am being clear on this situation. If not, please just ask. I have tried to find the Selenium API documentation to handle this, nope.
Test Code:
def test_00_validation_test(self):
driver = self.driver
driver.get(self.base_url)
driver.find_element_by_id("first_page").click()
driver.find_element_by_id("make_pick").click()
driver.find_element_by_xpath("(//input[@name='64'])[2]").click()
driver.find_element_by_id("save_pick").click()
self.assertEqual("Pick Was Saved", self.close_alert_and_get_its_text())
card_id = driver.find_element_by_id("testingNum").get_attribute("value")
driver.find_element_by_id("confirm_pick_page").click()
driver.find_element_by_id("pick_id", card_id).click()
driver.find_element_by_id("pick_id").click(card_id)as well, nope. I know those aren't valid, but was hoping as I can not find another way to handle this scenario.testingNumjust for testing purposes, with the value it is being assigned. I get and store that value ascard_id. So, when I go to theconfirm_pick_pageI can find it associated to thepick_idelement.