I'm currently facing a challenge when trying to access an element within an iframe. Despite successfully switching to the frame, Nightwatch keeps returning "element not found" whenever I attempt to verify its presence or visibility.
Below is a snippet of my code:
'User should be able to select client' : function(browser){
var mainframe;
browser
.pause(15000)
.waitForElementPresent("#cpmInteractionDivFrame", 45000)
.element('css selector', 'cpmInteractionDivFrame', function(result){
mainframe = result.value;
browser.frame(mainframe, function(result){
browser
.waitForElementVisible('#ClientProfileID', 35000)
.click("#ClientProfileID")
.waitForElementVisible('[option selected value="6032"]', 15000)
})
})
browser.end();
},
};
Has anyone encountered a similar issue or have any insights on what might be causing this problem?
-Appreciate your support