Jump to content

Clicking on unlisted element.


Recommended Posts

2 hours ago, Cyborg5000 said:

I have tried using _IEFormElementSetValue but that just sets the value, and when moved on to another window/xpath the value resets.

This is often a sign that the website is using some form of Javascript framework where the value is often stored in a separate hidden element. Looking at the HTML you posted earlier, I believe that site is using the ReactJS framework. I previously posted about it here.

You will need to figure this out yourself since we don't have access to the website.

Link to comment
Share on other sites

1 hour ago, Danp2 said:

This is often a sign that the website is using some form of Javascript framework where the value is often stored in a separate hidden element. Looking at the HTML you posted earlier, I believe that site is using the ReactJS framework. I previously posted about it here.

You will need to figure this out yourself since we don't have access to the website.

i find it weird, the 1st From timexpath //*[@id='compact-header']/div/div/div/div/div[1]/div[2]/input" changes the time for itself and the To timexpath:- //*[@id="compact-header"]/div/div/div/div/div[2]/div[2]/input

 

But in the script if i remove the 1st From xpath for checking, the To xpath doesn't change the time for the 1st but only itself.

Not a geek in xpaths, but seems to be looping somehow, which i guess or may be iam wrong.

image.png

Edited by Cyborg5000
Link to comment
Share on other sites

@Cyborg5000 Not sure how we can help you further unless you can provide access to the website.

FWIW, I've been able to manually update a react-datetime element from the Developer Tools console in Firefox --

var element = $('input');
var nativeInputValueSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value").set;
nativeInputValueSetter.call(element, '01:01 PM');
var event = new Event('input', { bubbles: true });
element.dispatchEvent(event);

Between this and the earlier example I linked to, you should be able to make this work.

Link to comment
Share on other sites

5 hours ago, Danp2 said:

@Cyborg5000 Not sure how we can help you further unless you can provide access to the website.

FWIW, I've been able to manually update a react-datetime element from the Developer Tools console in Firefox --

var element = $('input');
var nativeInputValueSetter = Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype, "value").set;
nativeInputValueSetter.call(element, '01:01 PM');
var event = new Event('input', { bubbles: true });
element.dispatchEvent(event);

Between this and the earlier example I linked to, you should be able to make this work.

Hi @Danp2

Very much appreciate your concern for helping, but this link is internal and only accessible via VPN.

Else it would had been easier for me to get all the things to you, and gaining more knowledge in handing such scenarios.

Link to comment
Share on other sites

Hello @Danp2

The issue that i had with the time change on both the end's got solved by trial and error using below.

removed first focus and clicks 😁

$xpathForumLink = ("//*[@id='compact-header']/div/div/div/div/div[1]/div[2]/input")
$aForumLink = BGe_IEGetDOMObjByXPathWithAttributes($oIE1, $xpathForumLink)
sleep (1000)
_IEPropertySet($aForumLink[0],"innertext" , "12:00 AM")
;_IEPropertySet($aForumLink[0],"innertext" , "12:00 AM")
sleep (1000)
_IEAction($aForumLink[0], "click")



$xpathForumLink = ("//*[@id='compact-header']/div/div/div/div/div[2]/div[2]/input")
$aForumLink = BGe_IEGetDOMObjByXPathWithAttributes($oIE1, $xpathForumLink)
sleep (1000)
_IEPropertySet($aForumLink[0],"innertext" , "12:00 PM")
;_IEPropertySet($aForumLink[0],"innertext" , "12:00 AM")
sleep (1000)
_IEAction($aForumLink[0], "click")

Should had tried these, dint realized that they were changing due to the focus/click's.

 

Thanks a lot for all the help you shared. Really appreciate it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...